linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Ni <nichen@iscas.ac.cn>
To: James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Chen Ni <nichen@iscas.ac.cn>
Subject: [PATCH] scsi: aha1740: use dma_mapping_error to check map errors
Date: Thu, 25 Apr 2024 16:28:03 +0800	[thread overview]
Message-ID: <20240425082803.829150-1-nichen@iscas.ac.cn> (raw)

The return value of dma_map_single() should be checked by
dma_mapping_error(). Update the check accordingly.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/scsi/aha1740.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index 3d18945abaf7..9768be6fc919 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -598,7 +598,7 @@ static int aha1740_probe (struct device *dev)
 	host->ecb_dma_addr = dma_map_single (&edev->dev, host->ecb,
 					     sizeof (host->ecb),
 					     DMA_BIDIRECTIONAL);
-	if (!host->ecb_dma_addr) {
+	if (dma_mapping_error(&edev->dev, host->ecb_dma_addr)) {
 		printk (KERN_ERR "aha1740_probe: Couldn't map ECB, giving up\n");
 		goto err_host_put;
 	}
-- 
2.25.1


                 reply	other threads:[~2024-04-25  8:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240425082803.829150-1-nichen@iscas.ac.cn \
    --to=nichen@iscas.ac.cn \
    --cc=James.Bottomley@HansenPartnership.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;
as well as URLs for NNTP newsgroup(s).