diff options
author | James Bottomley <jbottomley@parallels.com> | 2012-05-04 05:40:04 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-05-10 03:24:13 -0400 |
commit | 3c8d9a957d0ae62c2815393a781ab7ff4d5205e7 (patch) | |
tree | a20954c16b517c4561d88216830e288d7c0fefb4 /drivers/scsi/hosts.c | |
parent | 6abd7f132a4b74d9cdd3ef79fc71ca73909631f2 (diff) |
[SCSI] fix oops in all legacy host adapters caused by 6f381fa
Commit 6f381fa344911d5a234b13574433cf23036f9467
Author: Lin Ming <ming.m.lin@intel.com>
[SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue
Caused a regression where we oops in every legacy mode SCSI host driver
because they supply a NULL pointer to scsi_add_host(). Fix this by checking
for the NULL in scsi_add_host_with_dma() and changing the DMA device to being
the platform_bus in that case (which replicates the original behaviour).
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 351dc0b86fab..a3a056a9db67 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -218,6 +218,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, | |||
218 | 218 | ||
219 | if (!shost->shost_gendev.parent) | 219 | if (!shost->shost_gendev.parent) |
220 | shost->shost_gendev.parent = dev ? dev : &platform_bus; | 220 | shost->shost_gendev.parent = dev ? dev : &platform_bus; |
221 | if (!dma_dev) | ||
222 | dma_dev = shost->shost_gendev.parent; | ||
223 | |||
221 | shost->dma_dev = dma_dev; | 224 | shost->dma_dev = dma_dev; |
222 | 225 | ||
223 | error = device_add(&shost->shost_gendev); | 226 | error = device_add(&shost->shost_gendev); |