]> git.baikalelectronics.ru Git - kernel.git/commit
brcmsmac: fix wrap around in conversion from constant to s16
authorStefan Agner <stefan@agner.ch>
Sun, 17 Jun 2018 10:33:50 +0000 (12:33 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 27 Jun 2018 15:56:33 +0000 (18:56 +0300)
commitdf68c2c61918d33c189cd720c3cc38eea784c5e3
treed9622de69a7e6f61d10ce681e87fb46faf935a7a
parentd97a2b448047f3450a83e330d6c2886512dda145
brcmsmac: fix wrap around in conversion from constant to s16

The last value in the log_table wraps around to a negative value
since s16 has a value range of -32768 to 32767. This is not what
the table intends to represent. Use the closest positive value
32767.

This fixes a warning seen with clang:
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c:216:2: warning:
      implicit conversion from 'int' to 's16' (aka 'short') changes
value from 32768
      to -32768 [-Wconstant-conversion]
        32768
        ^~~~~
1 warning generated.

Fixes: aab029f002dc ("brcmsmac: fix array out-of-bounds access in qm_log10")
Cc: Tobias Regnery <tobias.regnery@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c