From: Junjie Mao Date: Mon, 22 Feb 2016 02:48:45 +0000 (+0800) Subject: USB: idmouse.c: Put the interface on error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0b41d35058468cb9cab3f856b3446a68416213e4;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- 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;