aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-08-01 22:45:28 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 11:58:52 -0700
commit17efe155253e3f81caa6cc57ec2af1c128618698 (patch)
tree4075a7dad14e51334db498665d4a1993fd1f6ba1 /drivers/usb/storage
parentUSB: build fixes: ohci-omap (diff)
downloadlinux-dev-17efe155253e3f81caa6cc57ec2af1c128618698.tar.xz
linux-dev-17efe155253e3f81caa6cc57ec2af1c128618698.zip
USB: onetouch - handle errors from input_register_device()
Onetouch: handle errors from input_register_device() Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/onetouch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index 313920d980c9..f843a0bcf107 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -135,6 +135,7 @@ int onetouch_connect_input(struct us_data *ss)
struct usb_onetouch *onetouch;
struct input_dev *input_dev;
int pipe, maxp;
+ int error = -ENOMEM;
interface = ss->pusb_intf->cur_altsetting;
@@ -211,15 +212,18 @@ int onetouch_connect_input(struct us_data *ss)
ss->suspend_resume_hook = usb_onetouch_pm_hook;
#endif
- input_register_device(onetouch->dev);
+ error = input_register_device(onetouch->dev);
+ if (error)
+ goto fail3;
return 0;
+ fail3: usb_free_urb(onetouch->irq);
fail2: usb_buffer_free(udev, ONETOUCH_PKT_LEN,
onetouch->data, onetouch->data_dma);
fail1: kfree(onetouch);
input_free_device(input_dev);
- return -ENOMEM;
+ return error;
}
void onetouch_release_input(void *onetouch_)