]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: fix rate mask reset
authorJohannes Berg <johannes.berg@intel.com>
Fri, 12 Feb 2021 10:22:14 +0000 (11:22 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 16 Mar 2021 20:13:06 +0000 (21:13 +0100)
commitc37eaa8eccfe3805cfc5e93031664fe6c590efe3
treebdde6403baf3a8f601158bc8516bb2882f6fa2de
parent3f74a89b75d0c136f275c55a571954a83f6cd7b5
mac80211: fix rate mask reset

Coverity reported the strange "if (~...)" condition that's
always true. It suggested that ! was intended instead of ~,
but upon further analysis I'm convinced that what really was
intended was a comparison to 0xff/0xffff (in HT/VHT cases
respectively), since this indicates that all of the rates
are enabled.

Change the comparison accordingly.

I'm guessing this never really mattered because a reset to
not having a rate mask is basically equivalent to having a
mask that enables all rates.

Reported-by: Colin Ian King <colin.king@canonical.com>
Fixes: 291aa463180f ("mac80211: fix and optimize MCS mask handling")
Fixes: 0bd6c563fb87 ("mac80211: add rate mask logic for vht rates")
Reviewed-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210212112213.36b38078f569.I8546a20c80bc1669058eb453e213630b846e107b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c