]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: ath12k: initialize 'ret' in ath12k_qmi_load_file_target_mem()
authorJeff Johnson <quic_jjohnson@quicinc.com>
Sat, 4 May 2024 18:52:08 +0000 (11:52 -0700)
committerKalle Valo <quic_kvalo@quicinc.com>
Mon, 13 May 2024 14:12:21 +0000 (17:12 +0300)
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 <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240504-qmi_load_file_target_mem-v1-1-069fc44c45eb@quicinc.com
drivers/net/wireless/ath/ath12k/qmi.c

index 3bb730326a024be34e1a636b4466bc6d105f168f..f273cb93dedb8cebf01efef1fe2103977cf47c73 100644 (file)
@@ -2538,7 +2538,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);