Dmitry Antipov <[email protected]> wrote:
> Fix the following warning observed with GCC 13.2 and -Wformat-truncation:
>
> drivers/net/wireless/ath/ath9k/hif_usb.c: In function ‘ath9k_hif_request_firmware’:
> drivers/net/wireless/ath/ath9k/hif_usb.c:1223:42: warning: ‘.0.fw’ directive output
> may be truncated writing 5 bytes into a region of size between 4 and 11 [-Wformat-truncation=]
> 1223 | "%s/htc_%s-%d.%s.0.fw", HTC_FW_PATH,
> | ^~~~~
> drivers/net/wireless/ath/ath9k/hif_usb.c:1222:17: note: ‘snprintf’ output between
> 27 and 34 bytes into a destination of size 32
> 1222 | snprintf(hif_dev->fw_name, sizeof(hif_dev->fw_name),
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1223 | "%s/htc_%s-%d.%s.0.fw", HTC_FW_PATH,
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1224 | chip, MAJOR_VERSION_REQ, index);
>
> According to the comment in 'ath9k_hif_request_firmware()', 36 bytes should be enough.
>
> Suggested-by: Kalle Valo <[email protected]>
> Signed-off-by: Dmitry Antipov <[email protected]>
As I didn't get any replies to my RFH I unfortunately already fixed this myself:
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
I just used a bigger buffer than you.
--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches