提交 3c8d9a95 编写于 作者: J James Bottomley 提交者: James Bottomley

[SCSI] fix oops in all legacy host adapters caused by 6f381fa3

Commit 6f381fa3
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: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 6abd7f13
...@@ -218,6 +218,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, ...@@ -218,6 +218,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
if (!shost->shost_gendev.parent) if (!shost->shost_gendev.parent)
shost->shost_gendev.parent = dev ? dev : &platform_bus; shost->shost_gendev.parent = dev ? dev : &platform_bus;
if (!dma_dev)
dma_dev = shost->shost_gendev.parent;
shost->dma_dev = dma_dev; shost->dma_dev = dma_dev;
error = device_add(&shost->shost_gendev); error = device_add(&shost->shost_gendev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册