]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 23 Apr 2021 09:56:09 +0000 (11:56 +0200)
commitb111344201c872b3ca5b6445a5510f2e473f8446
tree907f890994bd90b142eedc09e3601741e5fb92a6
parentf51abc6e3bb7b3e370fc81461b0410a9b0d9a74e
mac80211: fix rate mask reset

BugLink: https://bugs.launchpad.net/bugs/1923220
[ Upstream commit 1944015fe9c1d9fa5e9eb7ffbbb5ef8954d6753b ]

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: 2ffbe6d33366 ("mac80211: fix and optimize MCS mask handling")
Fixes: b119ad6e726c ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/mac80211/cfg.c