Skip to content

Commit

Permalink
dpaa_eth: Fix one possible memleak in dpaa_eth_probe
Browse files Browse the repository at this point in the history
When dma_coerce_mask_and_coherent() fails, the alloced netdev need to be freed.

Fixes: 060ad66 ("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>
  • Loading branch information
Liu Jian authored and David S. Miller committed Jul 21, 2020
1 parent d49e2c9 commit 6790711
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6790711

Please sign in to comment.