From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Jerin Jacob <jerinj@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>
Subject: [PATCH 3/4] graph: remove unnicessary null checks
Date: Wed, 22 Mar 2023 18:04:27 -0700 [thread overview]
Message-ID: <20230323010428.64020-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20230323010428.64020-1-stephen@networkplumber.org>
Checking for null before calling rte_mempool_free is
unnecessary.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/graph/graph_pcap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 9cbd1b8fdb6c..6c433300290b 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -40,8 +40,7 @@ void
graph_pcap_exit(struct rte_graph *graph)
{
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
- if (pkt_mp)
- rte_mempool_free(pkt_mp);
+ rte_mempool_free(pkt_mp);
if (pcapng_fd) {
rte_pcapng_close(pcapng_fd);
--
2.39.2
next prev parent reply other threads:[~2023-03-23 1:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 1:04 [PATCH 0/4] Remove unnecessary null free checks Stephen Hemminger
2023-03-23 1:04 ` [PATCH 1/4] mldev: remove " Stephen Hemminger
2023-03-23 4:06 ` [EXT] " Srikanth Yalavarthi
2023-03-23 1:04 ` [PATCH 2/4] ml/cnkx: remove unnecessary null checks Stephen Hemminger
2023-03-23 4:14 ` [EXT] " Srikanth Yalavarthi
2023-03-23 1:04 ` Stephen Hemminger [this message]
2023-03-23 1:04 ` [PATCH 4/4] examples/fips_validation: remove unneeded " Stephen Hemminger
2023-03-23 9:33 ` [PATCH 0/4] Remove unnecessary null free checks Thomas Monjalon
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=20230323010428.64020-4-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.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).