Skip to content

Commit

Permalink
wifi: ath12k: initialize 'ret' in ath12k_qmi_load_file_target_mem()
Browse files Browse the repository at this point in the history
[ Upstream commit bb0b0a6 ]

smatch flagged the following issue:

drivers/net/wireless/ath/ath12k/qmi.c:2619 ath12k_qmi_load_file_target_mem() error: uninitialized symbol 'ret'.

The reality is that 'ret' is initialized in every path through
ath12k_qmi_load_file_target_mem() except one, the case where the input
'len' is 0, and hence the "while (remaining)" loop is never entered.
But to make sure this case is also handled, add an initializer to the
declaration of 'ret'.

No functional changes, compile tested only.

Signed-off-by: Jeff Johnson <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Jeff Johnson authored and gregkh committed Sep 8, 2024
1 parent 59f742e commit 17d89c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath12k/qmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,7 @@ static int ath12k_qmi_load_file_target_mem(struct ath12k_base *ab,
struct qmi_wlanfw_bdf_download_resp_msg_v01 resp;
struct qmi_txn txn = {};
const u8 *temp = data;
int ret;
int ret = 0;
u32 remaining = len;

req = kzalloc(sizeof(*req), GFP_KERNEL);
Expand Down

0 comments on commit 17d89c7

Please sign in to comment.