[PATCH] net: broadcom: Catch the Exception

Subsystems: broadcom bcm4908 ethernet driver, networking drivers, the rest

STALE1770d

2 messages, 2 authors, 2021-12-03 · open the first message on its own page

[PATCH] net: broadcom: Catch the Exception

From: Jiasheng Jiang <hidden>
Date: 2021-12-03 01:26:49

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: 9d61d138ab30 ("net: broadcom: rename BCM4908 driver & update DT
binding")
Signed-off-by: Jiasheng Jiang <redacted>
---
 drivers/net/ethernet/broadcom/bcm4908_enet.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c
index 02a569500234..376f81796a29 100644
--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
@@ -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)
-- 
2.25.1

Re: [PATCH] net: broadcom: Catch the Exception

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-12-03 02:51:45

On Fri,  3 Dec 2021 09:26:15 +0800 Jiasheng Jiang wrote:
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: 9d61d138ab30 ("net: broadcom: rename BCM4908 driver & update DT
binding")
Please don't line wrap the Fixes tags.

Please CC Florian as he reviewed the original patch.

Repost with those changes made. 

Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help