public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>,
	linux1394-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH] fix crash in sbp2_remove_device() when dma_set_mask() fails
Date: Mon, 6 Aug 2007 14:20:59 +0200	[thread overview]
Message-ID: <20070806122059.GA1951@suse.de> (raw)

Fix crash in sbp2_remove_device() when dma_set_mask() fails.

Signed-off-by: Olaf Hering <olh@suse.de>

---
 drivers/ieee1394/sbp2.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -929,13 +929,14 @@ static void sbp2_remove_device(struct sb
 	if (!lu)
 		return;
 
-	hi = lu->hi;
-
 	if (lu->shost) {
 		scsi_remove_host(lu->shost);
 		scsi_host_put(lu->shost);
 	}
 	flush_scheduled_work();
+	hi = lu->hi;
+	if (!hi)
+		return;
 	sbp2util_remove_command_orb_pool(lu);
 
 	list_del(&lu->lu_list);
@@ -977,8 +978,7 @@ static void sbp2_remove_device(struct sb
 
 	lu->ud->device.driver_data = NULL;
 
-	if (hi)
-		module_put(hi->host->driver->owner);
+	module_put(hi->host->driver->owner);
 
 	kfree(lu);
 }

             reply	other threads:[~2007-08-06 12:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-06 12:20 Olaf Hering [this message]
2007-08-06 23:10 ` [PATCH] fix crash in sbp2_remove_device() when dma_set_mask() fails Stefan Richter
2007-08-11  9:45 ` Stefan Richter
2007-08-11  9:51   ` [PATCH] ieee1394: sbp2: fix sbp2_remove_device for error cases Stefan Richter
2007-08-11  9:52     ` [PATCH] ieee1394: sbp2: fix unsafe iteration over list of devices Stefan Richter

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=20070806122059.GA1951@suse.de \
    --to=olh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=stefanr@s5r6.in-berlin.de \
    /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