Skip to contentSkip to conversation

hso: fix soft-lockup

PATCH Applied [email protected] 2 participants 2 messages Nov 17, 2009 – Nov 23, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 hso: fix soft-lockup

From: Antti Kaijanmäki <[email protected]>

Fix soft-lockup in hso.c which is triggered on SMP machine when modem is removed while file descriptor(s) under /dev are still open:

old version called kref_put() too early which resulted in destroying hso_serial and hso_device objects which were still used later on.

---

 drivers/net/usb/hso.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/usb/hso.c renamed from drivers/net/usb/hso.c~hso-fix-soft-lockup +3 -1
diff -puN drivers/net/usb/hso.c~hso-fix-soft-lockup drivers/net/usb/hso.c
@@ -1363,7 +1363,7 @@ static void hso_serial_close(struct tty_
 	/* reset the rts and dtr */
 	/* do the actual close */
 	serial->open_count--;
-	kref_put(&serial->parent->ref, hso_serial_ref_free);
+
 	if (serial->open_count <= 0) {
 		serial->open_count = 0;
 		spin_lock_irq(&serial->serial_lock);
@@ -1383,6 +1383,8 @@ static void hso_serial_close(struct tty_
 		usb_autopm_put_interface(serial->parent->interface);
 
 	mutex_unlock(&serial->parent->mutex);
+
+	kref_put(&serial->parent->ref, hso_serial_ref_free);
 }
 
 /* close the requested serial port */

_

maintainer Applied
#1 lore raw

From: [email protected]
Date: Tue, 17 Nov 2009 14:50:32 -0800

Quoted 8 lines

From: Antti Kaijanmäki <[email protected]>

Fix soft-lockup in hso.c which is triggered on SMP machine when modem is removed while file descriptor(s) under /dev are still open:

old version called kref_put() too early which resulted in destroying hso_serial and hso_device objects which were still used later on.

Quoted 6 lines

Applied to net-2.6