From: "Ariel Otilibili-Anieli" <otilibil@eurecom.fr>
To: "Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH 1/1] common/sfc_efx/base: remove unreachable code
Date: Sat, 21 Dec 2024 19:20:21 +0100 [thread overview]
Message-ID: <2f7a89-67670700-c0c7-70827e80@126510310> (raw)
In-Reply-To: <02eaeb6f-73e9-47bf-beee-72af2ac16d23@oktetlabs.ru>
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);
> >
>
prev parent reply other threads:[~2024-12-21 18:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-21 13:27 [PATCH 0/1] " 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 message]
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=2f7a89-67670700-c0c7-70827e80@126510310 \
--to=otilibil@eurecom.fr \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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).