From 98cdcd6c6b4a3abacc65dd7ec66a230a5dffc3f8 Mon Sep 17 00:00:00 2001 From: Zheyu Ma Date: Mon, 28 Feb 2022 14:54:15 +0000 Subject: scsi: wd719x: Return proper error code when dma_set_mask() fails During the process of driver probing, the probe function should return < 0 for failure, otherwise the kernel will treat value >= 0 as success. Set 'err' to the error value returned by dma_set_mask() in case of failure. Link: https://lore.kernel.org/r/1646060055-11361-1-git-send-email-zheyuma97@gmail.com Reviewed-by: Johannes Thumshirn Signed-off-by: Zheyu Ma Signed-off-by: Martin K. Petersen --- drivers/scsi/wd719x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/scsi/wd719x.c') diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c index f341b79d8036..ff1b22077251 100644 --- a/drivers/scsi/wd719x.c +++ b/drivers/scsi/wd719x.c @@ -904,7 +904,8 @@ static int wd719x_pci_probe(struct pci_dev *pdev, const struct pci_device_id *d) if (err) goto fail; - if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { + err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (err) { dev_warn(&pdev->dev, "Unable to set 32-bit DMA mask\n"); goto disable_device; } -- cgit v1.2.3-70-g09d2