From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: coverity-bot <keescook@chromium.org>
Cc: Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Andrew Lunn <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Sergey Shtylyov <s.shtylyov@omp.ru>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
"linux-hardening@vger.kernel.org"
<linux-hardening@vger.kernel.org>
Subject: RE: Coverity: rswitch_gwca_queue_alloc_skb(): Control flow issues
Date: Mon, 7 Nov 2022 01:38:33 +0000 [thread overview]
Message-ID: <TYBPR01MB534103DBA4A6AA19EB26E2ABD83C9@TYBPR01MB5341.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <202211041229.F3B37C03@keescook>
Hello!
> From: coverity-bot, Sent: Saturday, November 5, 2022 4:30 AM
>
> Hello!
>
> This is an experimental semi-automated report about issues detected by
> Coverity from a scan of next-20221104 as part of the linux-next scan project:
<snip>
>
> You're getting this email because you were associated with the identified
> lines of code (noted below) that were touched by commits:
>
> Wed Nov 2 12:38:53 2022 +0000
> 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
>
> Coverity reported the following:
>
> *** CID 1527147: Control flow issues (NO_EFFECT)
> drivers/net/ethernet/renesas/rswitch.c:270 in rswitch_gwca_queue_alloc_skb()
> 264 goto err;
> 265 }
> 266
> 267 return 0;
> 268
> 269 err:
> vvv CID 1527147: Control flow issues (NO_EFFECT)
> vvv This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "i >= 0U".
> 270 for (i--; i >= 0; i--) {
> 271 index = (i + start_index) % gq->ring_size;
> 272 dev_kfree_skb(gq->skbs[index]);
> 273 gq->skbs[index] = NULL;
> 274 }
> 275
>
> If this is a false positive, please let us know so we can mark it as
> such, or teach the Coverity rules to be smarter. If not, please make
> sure fixes get into linux-next. :) For patches fixing this, please
> include these lines (but double-check the "Fixes" first):
Thank you for the report! I should fix the driver.
I also realized that rswitch_gwca_queue_ts_fill() has the same issue.
Best regards,
Yoshihiro Shimoda
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1527147 ("Control flow issues")
> Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
>
> Thanks for your attention!
>
> --
> Coverity-bot
prev parent reply other threads:[~2022-11-07 1:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 19:29 coverity-bot
2022-11-07 1:38 ` Yoshihiro Shimoda [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=TYBPR01MB534103DBA4A6AA19EB26E2ABD83C9@TYBPR01MB5341.jpnprd01.prod.outlook.com \
--to=yoshihiro.shimoda.uh@renesas.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gustavo@embeddedor.com \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=s.shtylyov@omp.ru \
/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
all inboxes | Powered by JetHome®