From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Gagandeep Singh <g.singh@nxp.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [PATCH 3/3] dmap/dpaa2: remove unnecessary null check
Date: Wed, 22 Jun 2022 11:51:58 -0700 [thread overview]
Message-ID: <20220622185158.397779-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20220622185158.397779-1-stephen@networkplumber.org>
The function rte_free already handles being called with NULL.
Found by nullfree.cocci.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/dma/dpaa2/dpaa2_qdma.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c
index a93a60565df7..0500e8c22590 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma.c
+++ b/drivers/dma/dpaa2/dpaa2_qdma.c
@@ -1404,11 +1404,9 @@ dpaa2_qdma_reset(struct rte_dma_dev *dev)
/* Reset and free virtual queues */
for (i = 0; i < qdma_dev->num_vqs; i++) {
- if (qdma_dev->vqs[i].status_ring)
- rte_ring_free(qdma_dev->vqs[i].status_ring);
+ rte_ring_free(qdma_dev->vqs[i].status_ring);
}
- if (qdma_dev->vqs)
- rte_free(qdma_dev->vqs);
+ rte_free(qdma_dev->vqs);
qdma_dev->vqs = NULL;
/* Reset QDMA device structure */
--
2.35.1
next prev parent reply other threads:[~2022-06-22 18:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 18:51 [PATCH 0/3] more null pointer check removal Stephen Hemminger
2022-06-22 18:51 ` [PATCH 1/3] vdpa/mlx5: remove unnecessary null check Stephen Hemminger
2022-06-23 9:13 ` Matan Azrad
2022-06-22 18:51 ` [PATCH 2/3] raw/ifpga: " Stephen Hemminger
2022-06-22 18:51 ` Stephen Hemminger [this message]
2022-06-22 19:05 ` [PATCH 0/3] more null pointer check removal Tyler Retzlaff
2022-06-23 0:43 ` fengchengwen
2022-06-24 12:39 ` David Marchand
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=20220622185158.397779-4-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=g.singh@nxp.com \
--cc=hemant.agrawal@nxp.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).