From: "Antti Kaijanmäki" <antti.kaijanmaki@nomovok.com>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
stable@kernel.org, Jan Dumon <j.dumon@option.com>
Subject: [PATCH] hso: fix soft-lockup
Date: Tue, 27 Oct 2009 16:26:56 +0200 [thread overview]
Message-ID: <1256653616.3591.114.camel@nomovok.homedomain> (raw)
In-Reply-To: <20091026194058.GA25263@kroah.com>
On Mon, 2009-10-26 at 12:40 -0700, Greg KH wrote:
> Yes, that should be a new patch, especially as it would not be needed
> to fix older kernels for the original bug.
>
> So, care to send 2 patches? The debug one isn't needed to be sent to
> the stable@kernel.org address.
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>
---
drivers/net/usb/hso.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 746839b..43bc3fc 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1363,7 +1363,7 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
/* 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_struct *tty, struct file *filp)
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 */
--
1.6.3.3
prev parent reply other threads:[~2009-10-27 14:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1256200578.3057.113.camel@nomovok.homedomain>
[not found] ` <20091026171550.GA24910@kroah.com>
[not found] ` <1256585855.3591.52.camel@nomovok.homedomain>
[not found] ` <20091026194058.GA25263@kroah.com>
2009-10-27 14:26 ` [PATCH] hso: fix debug routines Antti Kaijanmäki
2009-10-28 23:16 ` Andrew Morton
2009-10-29 6:57 ` Antti Kaijanmäki
2009-10-27 14:26 ` Antti Kaijanmäki [this message]
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=1256653616.3591.114.camel@nomovok.homedomain \
--to=antti.kaijanmaki@nomovok.com \
--cc=greg@kroah.com \
--cc=j.dumon@option.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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