Staging: rts5208: fix check for dma mapping error
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Tue, 9 Feb 2016 20:03:05 +0000 (23:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2016 01:43:09 +0000 (17:43 -0800)
use dma_mapping_error() instead of comparing the returned address with
zero after dma_map_single().

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/rtsx_transport.c

index f27491e802edeef46587208b6fc747d41c506270..0c9549bae986f0315a1c337d16788aeaeba2541d 100644 (file)
@@ -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)