DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] common/sfc_efx/base: remove unreachable code
@ 2024-12-21 13:27 Ariel Otilibili
  2024-12-21 13:27 ` [PATCH 1/1] " Ariel Otilibili
  0 siblings, 1 reply; 4+ messages in thread
From: Ariel Otilibili @ 2024-12-21 13:27 UTC (permalink / raw)
  To: dev; +Cc: Ariel Otilibili, stable, Andrew Rybchenko

Hello,

This patch clears out Coverity ID 121742.

Thank you,

Ariel Otilibili (1):
  common/sfc_efx/base: remove unreachable code

 drivers/common/sfc_efx/base/efx_mon.c | 3 ---
 1 file changed, 3 deletions(-)

-- 
2.47.1


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

* [PATCH 1/1] common/sfc_efx/base: remove unreachable code
  2024-12-21 13:27 [PATCH 0/1] common/sfc_efx/base: remove unreachable code Ariel Otilibili
@ 2024-12-21 13:27 ` Ariel Otilibili
  2024-12-21 17:42   ` Andrew Rybchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Ariel Otilibili @ 2024-12-21 13:27 UTC (permalink / raw)
  To: dev; +Cc: Ariel Otilibili, stable, Andrew Rybchenko

The default switch case ends with a goto; meaning these instructions are
never reached.

Coverity issue: 121742
Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
--
Cc: stable@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/common/sfc_efx/base/efx_mon.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/common/sfc_efx/base/efx_mon.c b/drivers/common/sfc_efx/base/efx_mon.c
index ee449ef5eb..5706171abd 100644
--- a/drivers/common/sfc_efx/base/efx_mon.c
+++ b/drivers/common/sfc_efx/base/efx_mon.c
@@ -80,9 +80,6 @@ efx_mon_init(
 		goto fail2;
 	}
 
-	emp->em_emop = emop;
-	return (0);
-
 fail2:
 	EFSYS_PROBE(fail2);
 
-- 
2.47.1


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

* Re: [PATCH 1/1] common/sfc_efx/base: remove unreachable code
  2024-12-21 13:27 ` [PATCH 1/1] " Ariel Otilibili
@ 2024-12-21 17:42   ` Andrew Rybchenko
  2024-12-21 18:20     ` Ariel Otilibili-Anieli
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Rybchenko @ 2024-12-21 17:42 UTC (permalink / raw)
  To: Ariel Otilibili, dev; +Cc: stable

NACK

it is the base driver and corresponding code is unreachable with current
build options only.

On 12/21/24 16:27, Ariel Otilibili wrote:
> The default switch case ends with a goto; meaning these instructions are
> never reached.
> 
> Coverity issue: 121742
> Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
> Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
> --
> Cc: stable@dpdk.org
> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
>   drivers/common/sfc_efx/base/efx_mon.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/common/sfc_efx/base/efx_mon.c b/drivers/common/sfc_efx/base/efx_mon.c
> index ee449ef5eb..5706171abd 100644
> --- a/drivers/common/sfc_efx/base/efx_mon.c
> +++ b/drivers/common/sfc_efx/base/efx_mon.c
> @@ -80,9 +80,6 @@ efx_mon_init(
>   		goto fail2;
>   	}
>   
> -	emp->em_emop = emop;
> -	return (0);
> -
>   fail2:
>   	EFSYS_PROBE(fail2);
>   


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

* Re: [PATCH 1/1] common/sfc_efx/base: remove unreachable code
  2024-12-21 17:42   ` Andrew Rybchenko
@ 2024-12-21 18:20     ` Ariel Otilibili-Anieli
  0 siblings, 0 replies; 4+ messages in thread
From: Ariel Otilibili-Anieli @ 2024-12-21 18:20 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: dev, stable

On Saturday, December 21, 2024 18:42 CET, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> wrote:

> NACK
> 
> it is the base driver and corresponding code is unreachable with current
> build options only.

Hello Andrew,

Thanks for having looked into this. It looks indeed like a false positive:

```
$ awk 'NR>67 && NR<88 {print NR ":" $0}' drivers/common/sfc_efx/base/efx_mon.c
68:
69:     EFSYS_ASSERT(encp->enc_mon_type != EFX_MON_INVALID);
70:     switch (emp->em_type) {
71:#if EFSYS_OPT_MON_MCDI
72:     case EFX_MON_SFC90X0:
73:     case EFX_MON_SFC91X0:
74:     case EFX_MON_SFC92X0:
75:             emop = &__efx_mon_mcdi_ops;
76:             break;
77:#endif
78:     default:
79:             rc = ENOTSUP;
80:             goto fail2;
81:     }
82:
83:     emp->em_emop = emop;
84:     return (0);
85:
86:fail2:
87:     EFSYS_PROBE(fail2);
```

This is the update I made in Coverity:

If EFSYS_OPT_MON_MCDI is enabled; and emp->em_type is any of EFX_MON_SFC90X0, EFX_MON_SFC91X0, or EFX_MON_SFC92X0; Lignes 82 and 83 are reached.

Regards,
Ariel

> 
> On 12/21/24 16:27, Ariel Otilibili wrote:
> > The default switch case ends with a goto; meaning these instructions are
> > never reached.
> > 
> > Coverity issue: 121742
> > Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
> > Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
> > --
> > Cc: stable@dpdk.org
> > Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> > ---
> >   drivers/common/sfc_efx/base/efx_mon.c | 3 ---
> >   1 file changed, 3 deletions(-)
> > 
> > diff --git a/drivers/common/sfc_efx/base/efx_mon.c b/drivers/common/sfc_efx/base/efx_mon.c
> > index ee449ef5eb..5706171abd 100644
> > --- a/drivers/common/sfc_efx/base/efx_mon.c
> > +++ b/drivers/common/sfc_efx/base/efx_mon.c
> > @@ -80,9 +80,6 @@ efx_mon_init(
> >   		goto fail2;
> >   	}
> >   
> > -	emp->em_emop = emop;
> > -	return (0);
> > -
> >   fail2:
> >   	EFSYS_PROBE(fail2);
> >   
>


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

end of thread, other threads:[~2024-12-21 18:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-21 13:27 [PATCH 0/1] common/sfc_efx/base: remove unreachable code Ariel Otilibili
2024-12-21 13:27 ` [PATCH 1/1] " Ariel Otilibili
2024-12-21 17:42   ` Andrew Rybchenko
2024-12-21 18:20     ` Ariel Otilibili-Anieli

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