wifi: ath12k: hal_rx: Use memset_startat() for clearing queue descriptors
authorThiraviyam Mariyappan <quic_tmariyap@quicinc.com>
Tue, 17 Jan 2023 12:03:18 +0000 (14:03 +0200)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 18 Jan 2023 06:37:56 +0000 (08:37 +0200)
commitb57f03200853817c06567fa8f0d02de0f2755d6a
tree7111094198007f988a9dc1862ef4c27f3a2d5bbc
parentd1335f0dc18fed0ecbe59862d4706b4a9ddfc050
wifi: ath12k: hal_rx: Use memset_startat() for clearing queue descriptors

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memset(), avoid intentionally writing across
neighboring fields.

Use memset_startat() so memset() doesn't get confused about writing
beyond the destination member that is intended to be the starting point
of zeroing through the end of the struct and fixes the below clang
warning.

Warning:
include/linux/fortify-string.h:314:4: warning: call to '__write_overflow_field' declared with 'warning' attribute:
detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-03171-QCAHKSWPL_SILICONZ-1
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thiraviyam Mariyappan <quic_tmariyap@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221221105529.19345-3-quic_tmariyap@quicinc.com
drivers/net/wireless/ath/ath12k/hal_rx.c