All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: wd719x: fix error return code of wd719x_pci_probe()
@ 2021-03-05  3:42 Jia-Ju Bai
  0 siblings, 0 replies; only message in thread
From: Jia-Ju Bai @ 2021-03-05  3:42 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, Jia-Ju Bai

When dma_set_mask() or pci_iomap() fails, no error return code of 
wd719x_pci_probe() is assigned.
To fix this bug, err is assigned with -EIO as error return code.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/scsi/wd719x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
index edc8a139a60d..a334e3c9de45 100644
--- a/drivers/scsi/wd719x.c
+++ b/drivers/scsi/wd719x.c
@@ -902,6 +902,7 @@ static int wd719x_pci_probe(struct pci_dev *pdev, const struct pci_device_id *d)
 	if (err)
 		goto fail;
 
+	err = -EIO;
 	if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
 		dev_warn(&pdev->dev, "Unable to set 32-bit DMA mask\n");
 		goto disable_device;
@@ -922,6 +923,7 @@ static int wd719x_pci_probe(struct pci_dev *pdev, const struct pci_device_id *d)
 		goto release_region;
 
 	wd = shost_priv(sh);
+	err = -EIO;
 	wd->base = pci_iomap(pdev, 0, 0);
 	if (!wd->base)
 		goto free_host;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-05  3:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05  3:42 [PATCH] scsi: wd719x: fix error return code of wd719x_pci_probe() Jia-Ju Bai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.