public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix crash in sbp2_remove_device() when dma_set_mask() fails
@ 2007-08-06 12:20 Olaf Hering
  2007-08-06 23:10 ` Stefan Richter
  2007-08-11  9:45 ` Stefan Richter
  0 siblings, 2 replies; 5+ messages in thread
From: Olaf Hering @ 2007-08-06 12:20 UTC (permalink / raw)
  To: Stefan Richter, linux1394-devel, linux-kernel

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);
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-11  9:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-06 12:20 [PATCH] fix crash in sbp2_remove_device() when dma_set_mask() fails Olaf Hering
2007-08-06 23:10 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox