Skip to content

Commit

Permalink
firewire: fw-sbp2: fix NULL pointer deref. in slave_alloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Richter committed Feb 19, 2008
1 parent 2e2705b commit 5513c5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 5513c5f

Please sign in to comment.