From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Akhil Goyal <gakhil@marvell.com>,
Fan Zhang <fanzhang.oss@gmail.com>,
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Subject: [PATCH 1/2] app/test: remove unnecessary null check before free
Date: Fri, 4 Aug 2023 09:41:55 -0700 [thread overview]
Message-ID: <20230804164156.118331-1-stephen@networkplumber.org> (raw)
No need to check for NULL pointer before calling these functions
Found by cocci/nullfree.cocci.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_cryptodev_asym.c | 3 +--
app/test/test_reassembly_perf.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 0ef2642fdd2b..c43a063b8262 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -565,8 +565,7 @@ ut_teardown_asym(void)
if (self->sess != NULL)
rte_cryptodev_asym_session_free(dev_id, self->sess);
- if (self->op != NULL)
- rte_crypto_op_free(self->op);
+ rte_crypto_op_free(self->op);
self->sess = NULL;
self->op = NULL;
self->result_op = NULL;
diff --git a/app/test/test_reassembly_perf.c b/app/test/test_reassembly_perf.c
index c11b65291fec..3af104b67348 100644
--- a/app/test/test_reassembly_perf.c
+++ b/app/test/test_reassembly_perf.c
@@ -81,8 +81,7 @@ reassembly_test_teardown(void)
if (frag_tbl != NULL)
rte_ip_frag_table_destroy(frag_tbl);
- if (pkt_pool != NULL)
- rte_mempool_free(pkt_pool);
+ rte_mempool_free(pkt_pool);
}
static void
--
2.39.2
next reply other threads:[~2023-08-04 16:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 16:41 Stephen Hemminger [this message]
2023-08-04 16:41 ` [PATCH 2/2] net/bnxt: remove unnecessary check for null " Stephen Hemminger
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=20230804164156.118331-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=fanzhang.oss@gmail.com \
--cc=gakhil@marvell.com \
--cc=konstantin.v.ananyev@yandex.ru \
/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).