* [PATCH] scsi: aha1740: use dma_mapping_error to check map errors
@ 2024-04-25 8:28 Chen Ni
0 siblings, 0 replies; only message in thread
From: Chen Ni @ 2024-04-25 8:28 UTC (permalink / raw
To: James.Bottomley, martin.petersen; +Cc: linux-scsi, linux-kernel, Chen Ni
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-25 8:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-25 8:28 [PATCH] scsi: aha1740: use dma_mapping_error to check map errors Chen Ni
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 read-only IMAP folder(s) and NNTP newsgroup(s).