lkml.org 
[lkml]   [2018]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: brcmsmac: fix wrap around in conversion from constant to s16
From
Date
Stefan Agner <stefan@agner.ch> wrote:

> 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: 4c0bfeaae9f9 ("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>

Patch applied to wireless-drivers-next.git, thanks.

c9a61469fc97 brcmsmac: fix wrap around in conversion from constant to s16

--
https://patchwork.kernel.org/patch/10468755/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

\
 
 \ /
  Last update: 2018-06-27 17:59    [W:0.051 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site