DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1 0/1] DPDK Coverity issue 381631, 381646
@ 2023-01-20 20:55 Hernan Vargas
  2023-01-20 20:55 ` [PATCH v1 1/1] baseband/acc: fix check after deref and dead code Hernan Vargas
  0 siblings, 1 reply; 3+ messages in thread
From: Hernan Vargas @ 2023-01-20 20:55 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, john.mcnamara, Hernan Vargas

Upstream fix to 23.03 for potential issue of dereferencing a pointer before null check.

Hernan Vargas (1):
  baseband/acc: fix check after deref and dead code

 drivers/baseband/acc/rte_acc100_pmd.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

-- 
2.37.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 1/1] baseband/acc: fix check after deref and dead code
  2023-01-20 20:55 [PATCH v1 0/1] DPDK Coverity issue 381631, 381646 Hernan Vargas
@ 2023-01-20 20:55 ` Hernan Vargas
  2023-02-06 15:22   ` Maxime Coquelin
  0 siblings, 1 reply; 3+ messages in thread
From: Hernan Vargas @ 2023-01-20 20:55 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, john.mcnamara, Hernan Vargas

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")

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)
 		return 0;
-#endif
+
 	op = acc_op_tail(q, 0);
 	if (unlikely(ops == NULL || op == NULL))
 		return 0;
-- 
2.37.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] baseband/acc: fix check after deref and dead code
  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
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2023-02-06 15:22 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, john.mcnamara



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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-06 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).