summaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-sbp2.c
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/fw-sbp2.c
parent2e2705bdcb959372d54bf7f79dd9a555ec2adfb4 (diff)
downloadop-kernel-dev-5513c5f6f9bd8c8ad3727130910fa288c62526a7.zip
op-kernel-dev-5513c5f6f9bd8c8ad3727130910fa288c62526a7.tar.gz
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/fw-sbp2.c')
-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 ea4811c..60ebcb5 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;
/*
OpenPOWER on IntegriCloud