USB: misc: more disconnect fixes
Subsystems (3)
cover USB: misc: more disconnect fixes
Turns out we have more gems in these old drivers.
Johan
Johan Hovold (2):
USB: ldusb: fix memleak on disconnect
USB: legousbtower: fix memleak on disconnect
drivers/usb/misc/ldusb.c | 5 +---- drivers/usb/misc/legousbtower.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-)
Signature · 1 line
2.23.0
PATCH 1/2 USB: ldusb: fix memleak on disconnect
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 2824bd250f0b ("[PATCH] USB: add ldusb driver")
Cc stable <[email protected]> # 2.6.13
Signed-off-by Johan Hovold <[email protected]>
--- drivers/usb/misc/ldusb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/misc/ldusb.c +1 -4
@@ -380,10 +380,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 ;
Signature · 1 line
2.23.0
PATCH 2/2 USB: legousbtower: fix memleak on disconnect
In reply to Johan HovoldIf 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 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc stable <[email protected]>
Signed-off-by Johan Hovold <[email protected]>
--- drivers/usb/misc/legousbtower.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/misc/legousbtower.c +1 -4
@@ -419,10 +419,7 @@ static int tower_release (struct inode *inode, struct file *file) goto exit; } -if (mutex_lock_interruptible (&dev->lock)) { - retval = -ERESTARTSYS ; - goto exit; - } +mutex_lock (&dev->lock);if (dev->open_count !=1 ) { dev_dbg(&dev->udev->dev, "%s: device not opened exactly once\n",
Signature · 1 line
2.23.0