DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Hernan Vargas <hernan.vargas@intel.com>,
	dev@dpdk.org, gakhil@marvell.com, trix@redhat.com
Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, john.mcnamara@intel.com
Subject: Re: [PATCH v1 1/1] baseband/acc: fix check after deref and dead code
Date: Mon, 6 Feb 2023 16:22:00 +0100	[thread overview]
Message-ID: <55627722-b8b9-f2e6-7264-53a15275751b@redhat.com> (raw)
In-Reply-To: <20230120205553.62419-2-hernan.vargas@intel.com>



On 1/20/23 21:55, Hernan Vargas wrote:
> Fix potential issue of dereferencing a pointer before null check.
> Remove null check for value that could never be null.
> 
> Coverity issue: 381646, 381631
> Fixes: 989dec301a9 ("baseband/acc100: add ring companion address")

Please Cc stable, since it fixes a patch merged in v22.11.

> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   drivers/baseband/acc/rte_acc100_pmd.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
> index 0992cb5d1e..a600511f4b 100644
> --- a/drivers/baseband/acc/rte_acc100_pmd.c
> +++ b/drivers/baseband/acc/rte_acc100_pmd.c
> @@ -4106,12 +4106,9 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
>   	int ret, cbm;
>   	struct rte_bbdev_enc_op *op;
>   
> -	if (q == NULL)
> -		return 0;
> -#ifdef RTE_LIBRTE_BBDEV_DEBUG
> -	if (unlikely(ops == 0))
> +	if (avail == 0)

Introduction of this new check on avail is not explained in the commit 
message, it does not seem related to the purpose of this patch.

It looks like an optimization, so should be in a separate patch.

>   		return 0;
> -#endif
> +
>   	op = acc_op_tail(q, 0);
>   	if (unlikely(ops == NULL || op == NULL))
>   		return 0;


  reply	other threads:[~2023-02-06 15:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 20:55 [PATCH v1 0/1] DPDK Coverity issue 381631, 381646 Hernan Vargas
2023-01-20 20:55 ` [PATCH v1 1/1] baseband/acc: fix check after deref and dead code Hernan Vargas
2023-02-06 15:22   ` Maxime Coquelin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-11-04  3:52 [PATCH v1 0/1] baseband/acc: coverity fix RC2 Hernan Vargas
2022-11-04  3:52 ` [PATCH v1 1/1] baseband/acc: fix check after deref and dead code Hernan Vargas
2022-11-04  8:51   ` Maxime Coquelin
2022-11-04 17:39     ` Chautru, Nicolas
2022-11-08 18:00       ` Chautru, Nicolas
2022-11-10  9:48   ` David Marchand
2022-11-10 21:15     ` Chautru, Nicolas
2022-11-15 15:17       ` Chautru, Nicolas
2022-11-15 15:59       ` David Marchand
2022-11-15 18:04         ` Chautru, Nicolas
2022-11-15 22:32           ` Chautru, Nicolas

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=55627722-b8b9-f2e6-7264-53a15275751b@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hernan.vargas@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=nicolas.chautru@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=trix@redhat.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).