Netdev List
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, akpm@linux-foundation.org,
	antti.kaijanmaki@nomovok.com, greg@kroah.com,
	randy.dunlap@oracle.com, stable@kernel.org
Subject: [patch for 2.6.32? 2/2] hso: fix soft-lockup
Date: Tue, 17 Nov 2009 14:50:32 -0800	[thread overview]
Message-ID: <200911172250.nAHMoW1k013162@imap1.linux-foundation.org> (raw)

From: Antti Kaijanmäki <antti.kaijanmaki@nomovok.com>

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>
Cc: Greg KH <greg@kroah.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/net/usb/hso.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -puN drivers/net/usb/hso.c~hso-fix-soft-lockup drivers/net/usb/hso.c
--- a/drivers/net/usb/hso.c~hso-fix-soft-lockup
+++ a/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 */
_

             reply	other threads:[~2009-11-17 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 22:50 akpm [this message]
2009-11-23 18:54 ` [patch for 2.6.32? 2/2] hso: fix soft-lockup David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200911172250.nAHMoW1k013162@imap1.linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=antti.kaijanmaki@nomovok.com \
    --cc=davem@davemloft.net \
    --cc=greg@kroah.com \
    --cc=netdev@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox