From: Zheyu Ma <zheyuma97@gmail.com>
To: jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Zheyu Ma <zheyuma97@gmail.com>
Subject: [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails
Date: Mon, 28 Feb 2022 14:54:15 +0000 [thread overview]
Message-ID: <1646060055-11361-1-git-send-email-zheyuma97@gmail.com> (raw)
During the process of driver probing, the probe function should return < 0
for failure, otherwise, the kernel will treat value >= 0 as success.
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
drivers/scsi/wd719x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
index 1a7947554581..2b24ef387d57 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;
}
--
2.25.1
next reply other threads:[~2022-02-28 14:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-28 14:54 Zheyu Ma [this message]
2022-02-28 15:43 ` Johannes Thumshirn
2022-03-02 4:22 ` Martin K. Petersen
2022-03-09 4:14 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1646060055-11361-1-git-send-email-zheyuma97@gmail.com \
--to=zheyuma97@gmail.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®