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>, <nicolas.chautru@intel.com>
Subject: [dpdk-dev] [PATCH] baseband/turbo_sw: fix dereference of null
Date: Thu, 22 Apr 2021 17:25:05 +0800	[thread overview]
Message-ID: <1619083505-65454-1-git-send-email-humin29@huawei.com> (raw)

Return value of a function 'rte_malloc' is dereferenced without
checking, and may result in segmetation fault.

This patch fixed it.

Fixes: 31a7853d1ed9 ("baseband/turbo_sw: support large size code block")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 app/test-bbdev/test_bbdev_perf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 45b85b9..f94e2a9 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -957,6 +957,9 @@ init_op_data_objs(struct rte_bbdev_op_data *bufs,
 			if ((op_type == DATA_INPUT) && large_input) {
 				/* Allocate a fake overused mbuf */
 				data = rte_malloc(NULL, seg->length, 0);
+				TEST_ASSERT_NOT_NULL(data,
+					"rte malloc failed with %u bytes",
+					seg->length);
 				memcpy(data, seg->addr, seg->length);
 				m_head->buf_addr = data;
 				m_head->buf_iova = rte_malloc_virt2iova(data);
-- 
2.7.4


             reply	other threads:[~2021-04-22  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  9:25 Min Hu (Connor) [this message]
2021-04-22 15:20 ` Chautru, Nicolas
2021-05-05 13:57   ` Akhil Goyal

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=1619083505-65454-1-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=nicolas.chautru@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).