firewire: fw-sbp2: better fix for NULL pointer dereference in scsi_remove_device
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 26 Feb 2008 22:30:02 +0000 (23:30 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 2 Mar 2008 11:35:46 +0000 (12:35 +0100)
commitf8436158b1d76e6842856048f287799468b56eb2
tree45f1b707668819b83fee5a8d82a7c5333b989f0f
parentd395991c117d43bfca97101a931a41d062a93852
firewire: fw-sbp2: better fix for NULL pointer dereference in scsi_remove_device

Patch "firewire: fw-sbp2: fix NULL pointer deref. in scsi_remove_device"
had the unintended effect that firewire-sbp2 could not be unloaded
anymore until all SBP-2 devices were unplugged.

We now fix the NULL pointer bug by reacquiring a reference to the sdev
instead of holding a reference to the sdev (and to the module) all the
time.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Tested-by: Jarod Wilson <jwilson@redhat.com>
drivers/firewire/fw-sbp2.c