Skip to content

Commit 3c8d9a9

Browse files
James BottomleyJames Bottomley
authored andcommitted
[SCSI] fix oops in all legacy host adapters caused by 6f381fa
Commit 6f381fa Author: Lin Ming <[email protected]> [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 <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 6abd7f1 commit 3c8d9a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/scsi/hosts.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
218218

219219
if (!shost->shost_gendev.parent)
220220
shost->shost_gendev.parent = dev ? dev : &platform_bus;
221+
if (!dma_dev)
222+
dma_dev = shost->shost_gendev.parent;
223+
221224
shost->dma_dev = dma_dev;
222225

223226
error = device_add(&shost->shost_gendev);

0 commit comments

Comments
 (0)