DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chautru, Nicolas" <nicolas.chautru@intel.com>
To: "Min Hu (Connor)" <humin29@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Yigit, Ferruh" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] baseband/turbo_sw: fix dereference of null
Date: Thu, 22 Apr 2021 15:20:27 +0000	[thread overview]
Message-ID: <BY5PR11MB445174D0CB0C99E3100534F2F8469@BY5PR11MB4451.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1619083505-65454-1-git-send-email-humin29@huawei.com>



> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Thursday, April 22, 2021 2:25 AM
> 
> 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>

Acked-by: Nicolas Chautru <nicolas.chautru@intel.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 15:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  9:25 Min Hu (Connor)
2021-04-22 15:20 ` Chautru, Nicolas [this message]
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=BY5PR11MB445174D0CB0C99E3100534F2F8469@BY5PR11MB4451.namprd11.prod.outlook.com \
    --to=nicolas.chautru@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=humin29@huawei.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).