All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Jian <liujian56@huawei.com>
To: <madalin.bucur@nxp.com>, <davem@davemloft.net>, <kuba@kernel.org>,
	<laurentiu.tudor@nxp.com>, <netdev@vger.kernel.org>
Subject: [PATCH v2 net] dpaa_eth: Fix one possible memleak in dpaa_eth_probe
Date: Mon, 20 Jul 2020 22:28:29 +0800	[thread overview]
Message-ID: <20200720142829.40067-1-liujian56@huawei.com> (raw)

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>
---

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(-)

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,
-- 
2.17.1


             reply	other threads:[~2020-07-20 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 14:28 Liu Jian [this message]
2020-07-20 17:43 ` [PATCH v2 net] dpaa_eth: Fix one possible memleak in dpaa_eth_probe Madalin Bucur (OSS)
2020-07-21  0:54 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200720142829.40067-1-liujian56@huawei.com \
    --to=liujian56@huawei.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=laurentiu.tudor@nxp.com \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.