Skip to content

Commit c326de5

Browse files
hreineckemartinkpetersen
authored andcommitted
scsi: aic94xx: fix calls to dma_set_mask_and_coherent()
The change to use dma_set_mask_and_coherent() incorrectly made a second call with the 32 bit DMA mask value when the call with the 64 bit DMA mask value succeeded. [mkp: fixed subject] Fixes: 3a21986 ("scsi: aic94xx: fully convert to the generic DMA API") Cc: <stable@vger.kernel.org> Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 1feb3b0 commit c326de5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/scsi/aic94xx/aic94xx_init.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,11 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
769769
if (err)
770770
goto Err_remove;
771771

772-
err = -ENODEV;
773-
if (dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)) ||
774-
dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32))) {
772+
err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
773+
if (err)
774+
err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
775+
if (err) {
776+
err = -ENODEV;
775777
asd_printk("no suitable DMA mask for %s\n", pci_name(dev));
776778
goto Err_remove;
777779
}

0 commit comments

Comments
 (0)