diff options
Diffstat (limited to 'drivers/usb/input/wacom_sys.c')
-rw-r--r-- | drivers/usb/input/wacom_sys.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/usb/input/wacom_sys.c b/drivers/usb/input/wacom_sys.c index 12b42746ded8..48988e63ebec 100644 --- a/drivers/usb/input/wacom_sys.c +++ b/drivers/usb/input/wacom_sys.c | |||
@@ -201,6 +201,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
201 | struct wacom *wacom; | 201 | struct wacom *wacom; |
202 | struct wacom_wac *wacom_wac; | 202 | struct wacom_wac *wacom_wac; |
203 | struct input_dev *input_dev; | 203 | struct input_dev *input_dev; |
204 | int error = -ENOMEM; | ||
204 | char rep_data[2], limit = 0; | 205 | char rep_data[2], limit = 0; |
205 | 206 | ||
206 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); | 207 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); |
@@ -252,7 +253,9 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
252 | wacom->irq->transfer_dma = wacom->data_dma; | 253 | wacom->irq->transfer_dma = wacom->data_dma; |
253 | wacom->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 254 | wacom->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
254 | 255 | ||
255 | input_register_device(wacom->dev); | 256 | error = input_register_device(wacom->dev); |
257 | if (error) | ||
258 | goto fail3; | ||
256 | 259 | ||
257 | /* Ask the tablet to report tablet data. Repeat until it succeeds */ | 260 | /* Ask the tablet to report tablet data. Repeat until it succeeds */ |
258 | do { | 261 | do { |
@@ -265,11 +268,12 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
265 | usb_set_intfdata(intf, wacom); | 268 | usb_set_intfdata(intf, wacom); |
266 | return 0; | 269 | return 0; |
267 | 270 | ||
268 | fail2: usb_buffer_free(dev, 10, wacom_wac->data, wacom->data_dma); | 271 | fail3: usb_free_urb(wacom->irq); |
269 | fail1: input_free_device(input_dev); | 272 | fail2: usb_buffer_free(dev, 10, wacom_wac->data, wacom->data_dma); |
273 | fail1: input_free_device(input_dev); | ||
270 | kfree(wacom); | 274 | kfree(wacom); |
271 | kfree(wacom_wac); | 275 | kfree(wacom_wac); |
272 | return -ENOMEM; | 276 | return error; |
273 | } | 277 | } |
274 | 278 | ||
275 | static void wacom_disconnect(struct usb_interface *intf) | 279 | static void wacom_disconnect(struct usb_interface *intf) |