Skip to contentSkip to conversation

Coverity: rtw_ieee802_11_parse_elems(): Incorrect expression

DISCUSSION coverity-bot 1 participant 1 message Apr 8, 2021 Linux-next tree

lore
Share & tools
lore
#0 lore 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):

Addresses-Coverity-ID: 1503715 ("Incorrect expression")

Fixes 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")

Thanks for your attention!

Signature · 1 line
Coverity-bot