]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: bcm4908: Handle dma_set_coherent_mask error codes
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Fri, 3 Dec 2021 03:31:06 +0000 (11:31 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Dec 2021 14:18:53 +0000 (14:18 +0000)
The return value of dma_set_coherent_mask() is not always 0.
To catch the exception in case that dma is not support the mask.

Fixes: 27758605defa ("net: broadcom: rename BCM4908 driver & update DT binding")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcm4908_enet.c

index 7cc5213c575a1d40cc012d16a0feaf44c611c3cf..b07cb9bc5f2d0bbd5a02364a6100f6e1be806295 100644 (file)
@@ -708,7 +708,9 @@ static int bcm4908_enet_probe(struct platform_device *pdev)
 
        enet->irq_tx = platform_get_irq_byname(pdev, "tx");
 
-       dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+       err = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+       if (err)
+               return err;
 
        err = bcm4908_enet_dma_alloc(enet);
        if (err)