aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/onetouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/storage/onetouch.c')
-rw-r--r--drivers/usb/storage/onetouch.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index 026a587eb8dd..f843a0bcf107 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -28,7 +28,6 @@
28 * 28 *
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/input.h> 32#include <linux/input.h>
34#include <linux/init.h> 33#include <linux/init.h>
@@ -136,6 +135,7 @@ int onetouch_connect_input(struct us_data *ss)
136 struct usb_onetouch *onetouch; 135 struct usb_onetouch *onetouch;
137 struct input_dev *input_dev; 136 struct input_dev *input_dev;
138 int pipe, maxp; 137 int pipe, maxp;
138 int error = -ENOMEM;
139 139
140 interface = ss->pusb_intf->cur_altsetting; 140 interface = ss->pusb_intf->cur_altsetting;
141 141
@@ -212,15 +212,18 @@ int onetouch_connect_input(struct us_data *ss)
212 ss->suspend_resume_hook = usb_onetouch_pm_hook; 212 ss->suspend_resume_hook = usb_onetouch_pm_hook;
213#endif 213#endif
214 214
215 input_register_device(onetouch->dev); 215 error = input_register_device(onetouch->dev);
216 if (error)
217 goto fail3;
216 218
217 return 0; 219 return 0;
218 220
221 fail3: usb_free_urb(onetouch->irq);
219 fail2: usb_buffer_free(udev, ONETOUCH_PKT_LEN, 222 fail2: usb_buffer_free(udev, ONETOUCH_PKT_LEN,
220 onetouch->data, onetouch->data_dma); 223 onetouch->data, onetouch->data_dma);
221 fail1: kfree(onetouch); 224 fail1: kfree(onetouch);
222 input_free_device(input_dev); 225 input_free_device(input_dev);
223 return -ENOMEM; 226 return error;
224} 227}
225 228
226void onetouch_release_input(void *onetouch_) 229void onetouch_release_input(void *onetouch_)