summaryrefslogtreecommitdiff
path: root/drivers/firewire
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-02-17 14:56:19 +0100
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-02-19 19:57:23 +0100
commit5513c5f6f9bd8c8ad3727130910fa288c62526a7 (patch)
tree0212d6211a5d8e6429b340c19448c2654efc50f1 /drivers/firewire
parent2e2705bdcb959372d54bf7f79dd9a555ec2adfb4 (diff)
downloadlinux-3.10-5513c5f6f9bd8c8ad3727130910fa288c62526a7.tar.gz
linux-3.10-5513c5f6f9bd8c8ad3727130910fa288c62526a7.tar.bz2
linux-3.10-5513c5f6f9bd8c8ad3727130910fa288c62526a7.zip
firewire: fw-sbp2: fix NULL pointer deref. in slave_alloc
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>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/fw-sbp2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index ea4811c4551..60ebcb5fe21 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -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;
/*