From dtor@insightbb.com Tue Aug 1 19:45:33 2006 From: Dmitry Torokhov To: linux-usb-devel@lists.sourceforge.net Subject: USB: onetouch - handle errors from input_register_device() Date: Tue, 1 Aug 2006 22:45:28 -0400 Cc: Greg KH , Content-Disposition: inline Message-Id: <200608012245.28520.dtor@insightbb.com> Onetouch: handle errors from input_register_device() Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/onetouch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- gregkh-2.6.orig/drivers/usb/storage/onetouch.c +++ gregkh-2.6/drivers/usb/storage/onetouch.c @@ -135,6 +135,7 @@ int onetouch_connect_input(struct us_dat 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_dat 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_)