]> err.no Git - linux-2.6/commitdiff
firewire: fw-sbp2: fix NULL pointer deref. in slave_alloc
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 17 Feb 2008 13:56:19 +0000 (14:56 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 19 Feb 2008 18:57:23 +0000 (19:57 +0100)
Fix a kernel bug when running rescan-scsi-bus while a FireWire disk is
connected:  http://bugzilla.kernel.org/show_bug.cgi?id=10008

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/fw-sbp2.c

index ea4811c455124235948723d2fff456be7409e695..60ebcb5fe21aa3654a7c6c8eb45280ca2a478357 100644 (file)
@@ -1473,6 +1473,10 @@ static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
 {
        struct sbp2_logical_unit *lu = sdev->hostdata;
 
+       /* (Re-)Adding logical units via the SCSI stack is not supported. */
+       if (!lu)
+               return -ENOSYS;
+
        sdev->allow_restart = 1;
 
        /*