mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
USB: ldusb: fix memleak on disconnect
commitb14a39048cupstream. If disconnect() races with release() after a process has been interrupted, release() could end up returning early and the driver would fail to free its driver data. Fixes:2824bd250f("[PATCH] USB: add ldusb driver") Cc: stable <stable@vger.kernel.org> # 2.6.13 Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20191010125835.27031-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
afa3bc254e
commit
1b64bc2abc
@@ -384,10 +384,7 @@ static int ld_usb_release(struct inode *inode, struct file *file)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (mutex_lock_interruptible(&dev->mutex)) {
|
||||
retval = -ERESTARTSYS;
|
||||
goto exit;
|
||||
}
|
||||
mutex_lock(&dev->mutex);
|
||||
|
||||
if (dev->open_count != 1) {
|
||||
retval = -ENODEV;
|
||||
|
||||
Reference in New Issue
Block a user