diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-29 12:52:20 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-30 10:22:39 -0500 |
commit | e8bac9e0647dd04c83fd0bfe7cdfe2f6dfb100d0 (patch) | |
tree | 3de02f02a05e6cb58ce5cb5521206685935ea403 /drivers/scsi/scsi_transport_spi.c | |
parent | 671a99c8eb2f1dde08ac5538d8cd912047c61ddf (diff) | |
download | linux-rpi-e8bac9e0647dd04c83fd0bfe7cdfe2f6dfb100d0.tar.gz linux-rpi-e8bac9e0647dd04c83fd0bfe7cdfe2f6dfb100d0.tar.bz2 linux-rpi-e8bac9e0647dd04c83fd0bfe7cdfe2f6dfb100d0.zip |
[SCSI] scsi_transport_spi: fix oops in revalidate
The class_device->device conversion is causing an oops in revalidate
because it's assuming that the device_for_each_child iterator will only
return struct scsi_device children. The conversion made all former
class_devices children of the device as well, so this assumption is
broken. Fix it.
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_spi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_spi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 75a64a6cae8c..b29360ed0bdc 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -366,12 +366,14 @@ spi_transport_rd_attr(rti, "%d\n"); spi_transport_rd_attr(pcomp_en, "%d\n"); spi_transport_rd_attr(hold_mcs, "%d\n"); -/* we only care about the first child device so we return 1 */ +/* we only care about the first child device that's a real SCSI device + * so we return 1 to terminate the iteration when we find it */ static int child_iter(struct device *dev, void *data) { - struct scsi_device *sdev = to_scsi_device(dev); + if (!scsi_is_sdev_device(dev)) + return 0; - spi_dv_device(sdev); + spi_dv_device(to_scsi_device(dev)); return 1; } |