wifi: rtw89: fw: cast mfw_hdr pointer from address of zeroth byte of firmware->data
authorPing-Ke Shih <pkshih@realtek.com>
Tue, 25 Mar 2025 02:54:24 +0000 (10:54 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Mon, 31 Mar 2025 06:07:03 +0000 (14:07 +0800)
commitbc1265b5c982fc73077812a8be727ba3d734164b
tree47ecf8a5ee32bdecf9e9db2431273e751121e424
parent81433a8a4f404d3e52e8e591fdc9409101dadf57
wifi: rtw89: fw: cast mfw_hdr pointer from address of zeroth byte of firmware->data

The firmware->size is validated before using firmware->data, but Coverity
still reports:
  Downcasting "firmware->data" from "u8 const *" to "struct rtw89_mfw_hdr"
  implies that the data that this pointer points to is tainted."

Using &firmware->data[0] to avoid the warning. No change logic at all.

Addresses-Coverity-ID: 1494046 ("Untrusted loop bound")
Addresses-Coverity-ID: 1544385 ("Untrusted array index read")

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250325025424.14079-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/fw.c