dpaa_eth: Fix one possible memleak in dpaa_eth_probe
Subsystems (3)
PATCH v2 1/1 dpaa_eth: Fix one possible memleak in dpaa_eth_probe
When dma_coerce_mask_and_coherent() fails, the alloced netdev need to be freed.
---
v1->v2:
Change targeting from "net-next" to "net"
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1 -1
@@ -2938,7 +2938,7 @@ static int dpaa_eth_probe(struct platform_device *pdev) DMA_BIT_MASK(40));if (err) {netdev_err (net_dev,"dma_coerce_mask_and_coherent() failed\n" ); -return err; + goto free_netdev; }/* If fsl_fm_max_frm is set to a higher value than the all-common 1500,
Signature · 1 line
2.17.1
Quoted 37 lines
-----Original Message-----
From: Liu Jian <[email protected]>
Sent: Monday, July 20, 2020 5:28 PM
To: Madalin Bucur <[email protected]>; [email protected]; [email protected]; Laurentiu Tudor <[email protected]>; [email protected]
Subject: [PATCH v2 net]dpaa_eth: Fix one possible memleak indpaa_eth_probeWhen
dma_coerce_mask_and_coherent()fails, the alloced netdev need to be freed.Fixes 060ad66f9795 ("dpaa_eth: change DMA device")Signed-off-by Liu Jian <[email protected]>---
v1->v2:
Change targeting from "net-next" to "net"drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1
-1@@ -2938,7 +2938,7 @@ static int dpaa_eth_probe(struct platform_device *pdev) DMA_BIT_MASK(40));if (err) {netdev_err (net_dev,"dma_coerce_mask_and_coherent() failed\n"); -return err; + goto free_netdev; }
Quoted 4 lines
/* If
fsl_fm_max_frmis set to a higher value than the all-common
1500,
--
2.17.1
David Miller
maintainerFrom: Liu Jian <[email protected]>
Date: Mon, 20 Jul 2020 22:28:29 +0800
Quoted 4 lines
When
dma_coerce_mask_and_coherent()fails, the alloced netdev need to be freed.Fixes 060ad66f9795 ("dpaa_eth: change DMA device")Signed-off-by Liu Jian <[email protected]>
Applied and queued up for -stable, thanks.