[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <TYBPR01MB534103DBA4A6AA19EB26E2ABD83C9@TYBPR01MB5341.jpnprd01.prod.outlook.com>
Date: Mon, 7 Nov 2022 01:38:33 +0000
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To: coverity-bot <keescook@...omium.org>
CC: Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Richard Cochran <richardcochran@...il.com>,
Russell King <linux@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Sergey Shtylyov <s.shtylyov@....ru>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
"linux-next@...r.kernel.org" <linux-next@...r.kernel.org>,
"linux-hardening@...r.kernel.org" <linux-hardening@...r.kernel.org>
Subject: RE: Coverity: rswitch_gwca_queue_alloc_skb(): Control flow issues
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@...omium.org>
> Addresses-Coverity-ID: 1527147 ("Control flow issues")
> Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
>
> Thanks for your attention!
>
> --
> Coverity-bot
Powered by blists - more mailing lists