public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: rtw_ieee802_11_parse_elems(): Incorrect expression
Date: Thu, 8 Apr 2021 16:40:58 -0700	[thread overview]
Message-ID: <202104081640.BBEF957A@keescook> (raw)

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20210408 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Sat Apr 8 12:52:39 2017 +0200
    554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")

Coverity reported the following:

*** CID 1503715:  Incorrect expression  (IDENTICAL_BRANCHES)
/drivers/staging/rtl8723bs/core/rtw_ieee80211.c: 1003 in rtw_ieee802_11_parse_elems()
997     		case WLAN_EID_OPMODE_NOTIF:
998     			elems->vht_op_mode_notify = pos;
999     			elems->vht_op_mode_notify_len = elen;
1000     			break;
1001     		default:
1002     			unknown++;
vvv     CID 1503715:  Incorrect expression  (IDENTICAL_BRANCHES)
vvv     The same code is executed when the condition "!show_errors" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
1003     			if (!show_errors)
1004     				break;
1005     			break;
1006     		}
1007
1008     		left -= elen;

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

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1503715 ("Incorrect expression")
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")

Thanks for your attention!

-- 
Coverity-bot

                 reply	other threads:[~2021-04-08 23:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202104081640.BBEF957A@keescook \
    --to=keescook@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-next@vger.kernel.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