* [dpdk-dev] [PATCH v1] net/nfp: fix dangling pointer on failure
@ 2020-04-07 11:37 wangyunjian
2020-04-07 13:44 ` Heinrich Kuhn
0 siblings, 1 reply; 3+ messages in thread
From: wangyunjian @ 2020-04-07 11:37 UTC (permalink / raw)
To: dev; +Cc: heinrich.kuhn, jerry.lilijun, xudingke, Yunjian Wang, stable
From: Yunjian Wang <wangyunjian@huawei.com>
When nfp_pf_create_dev() is cleaning up, it does not correctly set
the dev_private variable to NULL, which will lead to a double free.
Fixes: ef28aa96e53b ("net/nfp: support multiprocess")
CC: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
drivers/net/nfp/nfp_net.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 64d9d218d..6e24a09a2 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -3451,9 +3451,10 @@ nfp_pf_create_dev(struct rte_pci_device *dev, int port, int ports,
probe_failed:
rte_free(port_name);
/* free ports private data if primary process */
- if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
rte_free(eth_dev->data->dev_private);
-
+ eth_dev->data->dev_private = NULL;
+ }
rte_eth_dev_release_port(eth_dev);
return retval;
--
2.19.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v1] net/nfp: fix dangling pointer on failure
2020-04-07 11:37 [dpdk-dev] [PATCH v1] net/nfp: fix dangling pointer on failure wangyunjian
@ 2020-04-07 13:44 ` Heinrich Kuhn
2020-04-08 11:22 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Kuhn @ 2020-04-07 13:44 UTC (permalink / raw)
To: wangyunjian, dev; +Cc: jerry.lilijun, xudingke, stable
On 2020/04/07 13:37, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> When nfp_pf_create_dev() is cleaning up, it does not correctly set
> the dev_private variable to NULL, which will lead to a double free.
>
> Fixes: ef28aa96e53b ("net/nfp: support multiprocess")
> CC: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Thanks Yunjian
Acked-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v1] net/nfp: fix dangling pointer on failure
2020-04-07 13:44 ` Heinrich Kuhn
@ 2020-04-08 11:22 ` Ferruh Yigit
0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2020-04-08 11:22 UTC (permalink / raw)
To: Heinrich Kuhn, wangyunjian, dev; +Cc: jerry.lilijun, xudingke, stable
On 4/7/2020 2:44 PM, Heinrich Kuhn wrote:
>
>
> On 2020/04/07 13:37, wangyunjian wrote:
>> From: Yunjian Wang <wangyunjian@huawei.com>
>>
>> When nfp_pf_create_dev() is cleaning up, it does not correctly set
>> the dev_private variable to NULL, which will lead to a double free.
>>
>> Fixes: ef28aa96e53b ("net/nfp: support multiprocess")
>> CC: stable@dpdk.org
>>
>> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
>
> Thanks Yunjian
>
> Acked-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-08 11:22 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:37 [dpdk-dev] [PATCH v1] net/nfp: fix dangling pointer on failure wangyunjian
2020-04-07 13:44 ` Heinrich Kuhn
2020-04-08 11:22 ` Ferruh Yigit
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).