From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: "Stephen Hemminger" <stephen@networkplumber.org>,
chaoyong.he@corigine.com,
"Niklas Söderlund" <niklas.soderlund@corigine.com>
Subject: [PATCH] net/nfp: fix duplicate call to rte_free
Date: Fri, 27 Sep 2024 14:57:53 -0700 [thread overview]
Message-ID: <20240927215753.606098-1-stephen@networkplumber.org> (raw)
Calling rte_free twice on same object will corrupt the heap.
Warning is:
In function 'nfp_pre_tun_table_check_del',
inlined from 'nfp_flow_destroy' at ../drivers/net/nfp/flower/nfp_flower_flow.c:5143:9:
../drivers/net/nfp/flower/nfp_flower_flow.c:3830:9: error: pointer 'entry' used after 'rte_free' [-Werror=use-after-free]
3830 | rte_free(entry);
| ^~~~~~~~~~~~~~~
../drivers/net/nfp/flower/nfp_flower_flow.c:3825:9: note: call to 'rte_free' here
3825 | rte_free(entry);
| ^~~~~~~~~~~~~~~
Fixes: d3c33bdf1f18 ("net/nfp: prepare for IPv4 UDP tunnel decap flow action")
Cc: chaoyong.he@corigine.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/nfp/flower/nfp_flower_flow.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c
index 0078455658..64a0062c8b 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -3822,7 +3822,6 @@ nfp_pre_tun_table_check_del(struct nfp_flower_representor *repr,
goto free_entry;
}
- rte_free(entry);
rte_free(find_entry);
priv->pre_tun_cnt--;
--
2.45.2
next reply other threads:[~2024-09-27 21:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 21:57 Stephen Hemminger [this message]
2024-10-10 2:11 ` Chaoyong He
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=20240927215753.606098-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=niklas.soderlund@corigine.com \
/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 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).