linux/drivers/net/wireless/ath/ath6kl
Kees Cook e3128a9d48 ath6kl: Use struct_group() to avoid size-mismatched casting
In builds with -Warray-bounds, casts from smaller objects to larger
objects will produce warnings. These can be overly conservative, but since
-Warray-bounds has been finding legitimate bugs, it is desirable to turn
it on globally. Instead of casting a u32 to a larger object, redefine
the u32 portion of the header to a separate struct that can be used for
both u32 operations and the distinct header fields. Silences this warning:

drivers/net/wireless/ath/ath6kl/htc_mbox.c: In function 'htc_wait_for_ctrl_msg':
drivers/net/wireless/ath/ath6kl/htc_mbox.c:2275:20: error: array subscript 'struct htc_frame_hdr[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
 2275 |         if (htc_hdr->eid != ENDPOINT_0)
      |                    ^~
drivers/net/wireless/ath/ath6kl/htc_mbox.c:2264:13: note: while referencing 'look_ahead'
 2264 |         u32 look_ahead;
      |             ^~~~~~~~~~

This change results in no executable instruction differences.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20211207063538.2767954-1-keescook@chromium.org
2021-12-09 10:00:12 +02:00
..
Kconfig
Makefile
bmi.c
bmi.h
cfg80211.c ath6kl: use eth_hw_addr_set() 2021-10-20 12:39:43 +03:00
cfg80211.h
common.h
core.c cfg80211: avoid holding the RTNL when calling the driver 2021-01-26 11:55:50 +01:00
core.h
debug.c ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd() 2021-05-13 18:32:15 +02:00
debug.h
hif-ops.h
hif.c
hif.h
htc-ops.h
htc.h ath6kl: Use struct_group() to avoid size-mismatched casting 2021-12-09 10:00:12 +02:00
htc_mbox.c ath6kl: Use struct_group() to avoid size-mismatched casting 2021-12-09 10:00:12 +02:00
htc_pipe.c
init.c cfg80211: avoid holding the RTNL when calling the driver 2021-01-26 11:55:50 +01:00
main.c
recovery.c
sdio.c
target.h
testmode.c
testmode.h
trace.c
trace.h
txrx.c
usb.c ath6kl: fix division by zero in send path 2021-10-28 10:34:20 +03:00
wmi.c ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point() 2021-08-29 10:12:50 +03:00
wmi.h