All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] dpaa_eth: Fix one possible memleak in dpaa_eth_probe
@ 2020-07-17  9:05 Liu Jian
  2020-07-18  1:41 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Jian @ 2020-07-17  9:05 UTC (permalink / raw)
  To: madalin.bucur, davem, kuba, laurentiu.tudor, netdev

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] dpaa_eth: Fix one possible memleak in dpaa_eth_probe
  2020-07-17  9:05 [PATCH net-next] dpaa_eth: Fix one possible memleak in dpaa_eth_probe Liu Jian
@ 2020-07-18  1:41 ` David Miller
  2020-07-20 13:44   ` liujian (CE)
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2020-07-18  1:41 UTC (permalink / raw)
  To: liujian56; +Cc: madalin.bucur, kuba, laurentiu.tudor, netdev

From: Liu Jian <liujian56@huawei.com>
Date: Fri, 17 Jul 2020 17:05:28 +0800

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

This is a bug fix introduced in v5.5, therefore it should be targetting
'net' instead of 'net-next'.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH net-next] dpaa_eth: Fix one possible memleak in dpaa_eth_probe
  2020-07-18  1:41 ` David Miller
@ 2020-07-20 13:44   ` liujian (CE)
  0 siblings, 0 replies; 3+ messages in thread
From: liujian (CE) @ 2020-07-20 13:44 UTC (permalink / raw)
  To: David Miller; +Cc: madalin.bucur, kuba, laurentiu.tudor, netdev



> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Saturday, July 18, 2020 9:42 AM
> To: liujian (CE) <liujian56@huawei.com>
> Cc: madalin.bucur@nxp.com; kuba@kernel.org; laurentiu.tudor@nxp.com;
> netdev@vger.kernel.org
> Subject: Re: [PATCH net-next] dpaa_eth: Fix one possible memleak in
> dpaa_eth_probe
> 
> From: Liu Jian <liujian56@huawei.com>
> Date: Fri, 17 Jul 2020 17:05:28 +0800
> 
> > 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>
> 
> This is a bug fix introduced in v5.5, therefore it should be targetting 'net'
> instead of 'net-next'.

Thank you David, I will send v2.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-20 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17  9:05 [PATCH net-next] dpaa_eth: Fix one possible memleak in dpaa_eth_probe Liu Jian
2020-07-18  1:41 ` David Miller
2020-07-20 13:44   ` liujian (CE)

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.