Messages in this thread Patch in this message | | | Date | Sun, 06 Dec 2009 16:01:13 -0800 | From | Greg KH <> | Subject | [097/119] hso: fix soft-lockup |
| |
2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------ From: Antti Kaijanmäki <antti.kaijanmaki@nomovok.com>
commit dcfcb256cc23c4436691b0fe677275306699d6a1 upstream.
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.
Signed-off-by: Antti Kaijanmäki <antti.kaijanmaki@nomovok.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
--- drivers/net/usb/hso.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -1362,7 +1362,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); @@ -1382,6 +1382,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 */
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |