Skip to contentSkip to conversation

patch "USB: ldusb: fix memleak on disconnect" added to usb-linus

PATCH [email protected] 1 participant 1 message Oct 15, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

USB: ldusb: fix memleak on disconnect

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From b14a39048c1156cfee76228bf449852da2f14df8 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Thu, 10 Oct 2019 14:58:34 +0200
Subject: 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
---
 drivers/usb/misc/ldusb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/misc/ldusb.c +1 -4
index f3108d85e768..147c90c2a4e5 100644
@@ -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