mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 12:52:30 +00:00
868fd970e1
Smatch complains: data_tx.c:37 wfx_get_hw_rate() warn: constraint '(struct ieee80211_supported_band)->bitrates' overflow 'band->bitrates' 0 <= abs_rl '0-127' user_rl '' required = '(struct ieee80211_supported_band)->n_bitrates' 23 struct ieee80211_supported_band *band; 24 25 if (rate->idx < 0) 26 return -1; 27 if (rate->flags & IEEE80211_TX_RC_MCS) { 28 if (rate->idx > 7) { 29 WARN(1, "wrong rate->idx value: %d", rate->idx); 30 return -1; 31 } 32 return rate->idx + 14; 33 } 34 // WFx only support 2GHz, else band information should be retrieved 35 // from ieee80211_tx_info 36 band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]; 37 return band->bitrates[rate->idx].hw_value; Add a simple check to make Smatch happy. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20201009171307.864608-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
||
---|---|---|
.. | ||
Documentation/devicetree/bindings/net/wireless | ||
bh.c | ||
bh.h | ||
bus_sdio.c | ||
bus_spi.c | ||
bus.h | ||
data_rx.c | ||
data_rx.h | ||
data_tx.c | ||
data_tx.h | ||
debug.c | ||
debug.h | ||
fwio.c | ||
fwio.h | ||
hif_api_cmd.h | ||
hif_api_general.h | ||
hif_api_mib.h | ||
hif_rx.c | ||
hif_rx.h | ||
hif_tx_mib.c | ||
hif_tx_mib.h | ||
hif_tx.c | ||
hif_tx.h | ||
hwio.c | ||
hwio.h | ||
Kconfig | ||
key.c | ||
key.h | ||
main.c | ||
main.h | ||
Makefile | ||
queue.c | ||
queue.h | ||
scan.c | ||
scan.h | ||
sta.c | ||
sta.h | ||
TODO | ||
traces.h | ||
wfx.h |