From: Jiri Slaby Date: Wed, 11 Mar 2009 20:47:38 +0000 (+0100) Subject: USB: misc/adutux, fix lock imbalance X-Git-Tag: firefly_0821_release~15285^2~10 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=46c9844c4014be53c67622dcd3ba4302f36e9cac;p=firefly-linux-kernel-4.4.55.git USB: misc/adutux, fix lock imbalance Don't unlock adutux_mutex when not held. Signed-off-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index 7b6922e08ed1..203526542013 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -376,7 +376,7 @@ static int adu_release(struct inode *inode, struct file *file) if (dev->open_count <= 0) { dbg(1," %s : device not opened", __func__); retval = -ENODEV; - goto exit; + goto unlock; } adu_release_internal(dev); @@ -385,9 +385,9 @@ static int adu_release(struct inode *inode, struct file *file) if (!dev->open_count) /* ... and we're the last user */ adu_delete(dev); } - -exit: +unlock: mutex_unlock(&adutux_mutex); +exit: dbg(2," %s : leave, return value %d", __func__, retval); return retval; }