aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/idmouse.c
diff options
context:
space:
mode:
authorJunjie Mao <junjie.mao@enight.me>2016-02-22 10:48:45 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-03 19:44:06 -0800
commit0b41d35058468cb9cab3f856b3446a68416213e4 (patch)
treec98e027ce054be3fee9fda71266e3ca4ba7c5269 /drivers/usb/misc/idmouse.c
parentusb: hub: fix a typo in hub_port_init() leading to wrong logic (diff)
downloadlinux-dev-0b41d35058468cb9cab3f856b3446a68416213e4.tar.xz
linux-dev-0b41d35058468cb9cab3f856b3446a68416213e4.zip
USB: idmouse.c: Put the interface on error
usb_autopm_put_interface() should be called regardless of what idmouse_create_image() returns. Signed-off-by: Junjie Mao <junjie.mao@enight.me> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/idmouse.c')
-rw-r--r--drivers/usb/misc/idmouse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
index 4e38683c653c..5105397e62fc 100644
--- a/drivers/usb/misc/idmouse.c
+++ b/drivers/usb/misc/idmouse.c
@@ -257,9 +257,9 @@ static int idmouse_open(struct inode *inode, struct file *file)
if (result)
goto error;
result = idmouse_create_image (dev);
+ usb_autopm_put_interface(interface);
if (result)
goto error;
- usb_autopm_put_interface(interface);
/* increment our usage count for the driver */
++dev->open;