wifi: ath11k: Fix qmi_msg_handler data structure initialization
authorRahul Bhattacharjee <quic_rbhattac@quicinc.com>
Fri, 21 Oct 2022 09:01:26 +0000 (14:31 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:00 +0000 (13:33 +0100)
[ Upstream commit ed3725e15a154ebebf44e0c34806c57525483f92 ]

qmi_msg_handler is required to be null terminated by QMI module.
There might be a case where a handler for a msg id is not present in the
handlers array which can lead to infinite loop while searching the handler
and therefore out of bound access in qmi_invoke_handler().
Hence update the initialization in qmi_msg_handler data structure.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1

Signed-off-by: Rahul Bhattacharjee <quic_rbhattac@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221021090126.28626-1-quic_rbhattac@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath11k/qmi.c

index 51de220..8358fe0 100644 (file)
@@ -3087,6 +3087,9 @@ static const struct qmi_msg_handler ath11k_qmi_msg_handlers[] = {
                        sizeof(struct qmi_wlfw_fw_init_done_ind_msg_v01),
                .fn = ath11k_qmi_msg_fw_init_done_cb,
        },
+
+       /* end of list */
+       {},
 };
 
 static int ath11k_qmi_ops_new_server(struct qmi_handle *qmi_hdl,