DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/octeontx: fix dangling pointer on failure
@ 2020-04-07 11:35 wangyunjian
  2020-04-08 12:49 ` [dpdk-dev] [EXT] " Harman Kalra
  0 siblings, 1 reply; 3+ messages in thread
From: wangyunjian @ 2020-04-07 11:35 UTC (permalink / raw)
  To: dev; +Cc: hkalra, jerry.lilijun, xudingke, Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

When octeontx_create() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.

Fixes: 9e399b88ce2f ("net/octeontx: fix memory leak of MAC address table")
CC: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/octeontx/octeontx_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index e8aa4ec78..437abd7e5 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -1181,6 +1181,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
 
 free_mac_addrs:
 	rte_free(data->mac_addrs);
+	data->mac_addrs = NULL;
 err:
 	if (nic)
 		octeontx_port_close(nic);
-- 
2.19.1



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

* Re: [dpdk-dev] [EXT] [PATCH v1] net/octeontx: fix dangling pointer on failure
  2020-04-07 11:35 [dpdk-dev] [PATCH v1] net/octeontx: fix dangling pointer on failure wangyunjian
@ 2020-04-08 12:49 ` Harman Kalra
  2020-05-04  2:20   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Harman Kalra @ 2020-04-08 12:49 UTC (permalink / raw)
  To: wangyunjian; +Cc: dev, jerry.lilijun, xudingke, stable

On Tue, Apr 07, 2020 at 07:35:43PM +0800, wangyunjian wrote:
> External Email
> 
> ----------------------------------------------------------------------
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> When octeontx_create() is cleaning up, it does not correctly set
> the mac_addrs variable to NULL, which will lead to a double free.
> 
> Fixes: 9e399b88ce2f ("net/octeontx: fix memory leak of MAC address table")
> CC: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>

Thanks for fixing.
Acked-by: Harman Kalra <hkalra@marvell.com>

> ---
>  drivers/net/octeontx/octeontx_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
> index e8aa4ec78..437abd7e5 100644
> --- a/drivers/net/octeontx/octeontx_ethdev.c
> +++ b/drivers/net/octeontx/octeontx_ethdev.c
> @@ -1181,6 +1181,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
>  
>  free_mac_addrs:
>  	rte_free(data->mac_addrs);
> +	data->mac_addrs = NULL;
>  err:
>  	if (nic)
>  		octeontx_port_close(nic);
> -- 
> 2.19.1
> 
> 

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

* Re: [dpdk-dev] [EXT] [PATCH v1] net/octeontx: fix dangling pointer on failure
  2020-04-08 12:49 ` [dpdk-dev] [EXT] " Harman Kalra
@ 2020-05-04  2:20   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2020-05-04  2:20 UTC (permalink / raw)
  To: Harman Kalra
  Cc: wangyunjian, dpdk-dev, Lilijun (Jerry), xudingke, dpdk stable

On Wed, Apr 8, 2020 at 6:19 PM Harman Kalra <hkalra@marvell.com> wrote:
>
> On Tue, Apr 07, 2020 at 07:35:43PM +0800, wangyunjian wrote:
> > External Email
> >
> > ----------------------------------------------------------------------
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > When octeontx_create() is cleaning up, it does not correctly set
> > the mac_addrs variable to NULL, which will lead to a double free.
> >
> > Fixes: 9e399b88ce2f ("net/octeontx: fix memory leak of MAC address table")
> > CC: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
>
> Thanks for fixing.
> Acked-by: Harman Kalra <hkalra@marvell.com>


Applied to dpdk-next-net-mrvl/master. Thanks


>
> > ---
> >  drivers/net/octeontx/octeontx_ethdev.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
> > index e8aa4ec78..437abd7e5 100644
> > --- a/drivers/net/octeontx/octeontx_ethdev.c
> > +++ b/drivers/net/octeontx/octeontx_ethdev.c
> > @@ -1181,6 +1181,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
> >
> >  free_mac_addrs:
> >       rte_free(data->mac_addrs);
> > +     data->mac_addrs = NULL;
> >  err:
> >       if (nic)
> >               octeontx_port_close(nic);
> > --
> > 2.19.1
> >
> >

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

end of thread, other threads:[~2020-05-04  2:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 11:35 [dpdk-dev] [PATCH v1] net/octeontx: fix dangling pointer on failure wangyunjian
2020-04-08 12:49 ` [dpdk-dev] [EXT] " Harman Kalra
2020-05-04  2:20   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).