summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLiu Jian <liujian56@huawei.com>2020-07-20 22:28:29 +0800
committerDavid S. Miller <davem@davemloft.net>2020-07-20 17:54:08 -0700
commit6790711f8ac5faabc43237c0d05d93db431a1ecc (patch)
tree0553d9b6ff12fb0c64a91a31a2ed90989aa67ec5 /drivers
parentd49e2c9e54ddc072fe38dcd838a78067757b13c8 (diff)
downloadlinux-6790711f8ac5faabc43237c0d05d93db431a1ecc.tar.bz2
dpaa_eth: Fix one possible memleak in dpaa_eth_probe
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 <liujian56@huawei.com> Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/freescale/dpaa/dpaa_eth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 2972244e6eb0..43570f4911ea 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -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,