Commit 6790711f authored by Liu Jian's avatar Liu Jian Committed by David S. Miller

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: 060ad66f ("dpaa_eth: change DMA device")
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
Acked-by: default avatarMadalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d49e2c9e
...@@ -2938,7 +2938,7 @@ static int dpaa_eth_probe(struct platform_device *pdev) ...@@ -2938,7 +2938,7 @@ static int dpaa_eth_probe(struct platform_device *pdev)
DMA_BIT_MASK(40)); DMA_BIT_MASK(40));
if (err) { if (err) {
netdev_err(net_dev, "dma_coerce_mask_and_coherent() failed\n"); 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, /* If fsl_fm_max_frm is set to a higher value than the all-common 1500,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment