DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <cristian.dumitrescu@intel.com>
Subject: [dpdk-dev] [PATCH] pipeline: fix deallocate null pointer
Date: Thu, 22 Apr 2021 14:38:30 +0800	[thread overview]
Message-ID: <1619073510-58316-1-git-send-email-humin29@huawei.com> (raw)

From: HongBo Zheng <zhenghongbo3@huawei.com>

Fix deallocate null pointer in instruction_config, while
pointer 'data' or 'instr' may be null.

Fixes: a1711f948dbf ("pipeline: add SWX Rx and extract instructions")
Cc: stable@dpdk.org

Signed-off-by: HongBo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 lib/librte_pipeline/rte_swx_pipeline.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c
index 4455d91..6084635 100644
--- a/lib/librte_pipeline/rte_swx_pipeline.c
+++ b/lib/librte_pipeline/rte_swx_pipeline.c
@@ -8015,8 +8015,10 @@ instruction_config(struct rte_swx_pipeline *p,
 	return 0;
 
 error:
-	free(data);
-	free(instr);
+	if (data)
+		free(data);
+	if (instr)
+		free(instr);
 	return err;
 }
 
-- 
2.7.4


             reply	other threads:[~2021-04-22  6:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  6:38 Min Hu (Connor) [this message]
2021-04-22  8:36 ` Dumitrescu, Cristian
2021-04-22  9:36   ` Min Hu (Connor)

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=1619073510-58316-1-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).