From ba7039c00774b6eb8131ea517b570d89c6625e0e Mon Sep 17 00:00:00 2001 From: Madalin Bucur Date: Tue, 25 Jun 2013 18:40:35 +0300 Subject: dpaa_eth: free buf_layout on error paths The allocated buf_layout must be freed on all error paths. Signed-off-by: Madalin Bucur Change-Id: Icf2e68f90c28adcc99fdc56492942f3595033b21 Reviewed-on: http://git.am.freescale.net:8181/3093 Reviewed-by: Sovaiala Cristian-Constantin-B39531 Reviewed-by: Radulescu Ruxandra Ioana-B05472 Reviewed-by: Fleming Andrew-AFLEMING Tested-by: Fleming Andrew-AFLEMING diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index 4d088c3..4cd08d5 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -3257,6 +3257,7 @@ get_channel_failed: dpa_bp_free(priv, priv->dpa_bp); bp_create_failed: fq_probe_failed: + devm_kfree(dev, buf_layout); alloc_failed: mac_probe_failed: dev_set_drvdata(dev, NULL); diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c index 1f3e519..21dda6d 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c @@ -132,8 +132,10 @@ static int dpaa_eth_proxy_probe(struct platform_device *_of_dev) if (!err) err = dpa_fq_probe_mac(dev, &proxy_fq_list, &port_fqs, true, TX); - if (err < 0) + if (err < 0) { + devm_kfree(dev, buf_layout); return err; + } /* Proxy initializer - Just configures the MAC on behalf of * another partition. diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c index 2d06be1..76f5e50 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c @@ -771,6 +771,7 @@ get_channel_failed: dpa_bp_free(priv, priv->dpa_bp); bp_create_failed: fq_probe_failed: + devm_kfree(dev, buf_layout); alloc_failed: mac_probe_failed: dev_set_drvdata(dev, NULL); -- cgit v0.10.2