All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix oops caused when writing to the rescan attribute
@ 2003-09-30 22:27 Mike Christie
  0 siblings, 0 replies; only message in thread
From: Mike Christie @ 2003-09-30 22:27 UTC (permalink / raw)
  To: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

If an upper layer driver is not loaded, and you write to a device's 
rescan attribute you will get an oops. The attached patch fixes this by 
testing if the device's driver variable is set before accessing it.


Mike Christie
mikenc@us.ibm.com

[-- Attachment #2: sysfs_rescan.patch --]
[-- Type: text/plain, Size: 479 bytes --]

--- linux-2.6.0-test6/drivers/scsi/scsi_scan.c	2003-09-27 17:50:40.000000000 -0700
+++ linux-2.6.0-test6-work/drivers/scsi/scsi_scan.c	2003-09-30 04:12:25.000000000 -0700
@@ -1080,8 +1080,12 @@
 
 void scsi_rescan_device(struct device *dev)
 {
-	struct scsi_driver *drv = to_scsi_driver(dev->driver);
+	struct scsi_driver *drv;
+	
+	if (!dev->driver)
+		return;
 
+	drv = to_scsi_driver(dev->driver);
 	if (try_module_get(drv->owner)) {
 		if (drv->rescan)
 			drv->rescan(dev);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-30 22:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-30 22:27 [PATCH] fix oops caused when writing to the rescan attribute Mike Christie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.