Skip to contentSkip to conversation

Staging: rts5208: fix check for dma mapping error

PATCH Superseded Haneen Mohammed 1 participant 1 message Feb 9, 2016 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 Staging: rts5208: fix check for dma mapping error

use dma_mapping_error() instead of comapring the returned address with zero after dma_map_single().

---
 drivers/staging/rts5208/rtsx_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/rtsx_transport.c +1 -1
index f27491e..0c9549b 100644
@@ -653,7 +653,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
 		return -ENXIO;
 
 	addr = dma_map_single(&(rtsx->pci->dev), buf, len, dma_dir);
-	if (!addr)
+	if (dma_mapping_error(&rtsx->pci->dev, addr))
 		return -ENOMEM;
 
 	if (card == SD_CARD)
Signature · 1 line
1.9.1