提交 8788f609 编写于 作者: A Alex Elder 提交者: Zheng Zengkai

net: ipa: terminate message handler arrays

stable inclusion
from stable-5.10.27
commit 6d3635ed12e780375857cbd80d2b46229443c669
bugzilla: 51493

--------------------------------

[ Upstream commit 3a9ef3e1 ]

When a QMI handle is initialized, an array of message handler
structures is provided, defining how any received message should
be handled based on its type and message ID.  The QMI core code
traverses this array when a message arrives and calls the function
associated with the (type, msg_id) found in the array.

The array is supposed to be terminated with an empty (all zero)
entry though.  Without it, an unsupported message will cause
the QMI core code to go past the end of the array.

Fix this bug, by properly terminating the message handler arrays
provided when QMI handles are set up by the IPA driver.

Fixes: 530f9216 ("soc: qcom: ipa: AP/modem communications")
Reported-by: NSujit Kautkar <sujitka@chromium.org>
Signed-off-by: NAlex Elder <elder@linaro.org>
Reviewed-by: NBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 c0cd5ddb
...@@ -249,6 +249,7 @@ static struct qmi_msg_handler ipa_server_msg_handlers[] = { ...@@ -249,6 +249,7 @@ static struct qmi_msg_handler ipa_server_msg_handlers[] = {
.decoded_size = IPA_QMI_DRIVER_INIT_COMPLETE_REQ_SZ, .decoded_size = IPA_QMI_DRIVER_INIT_COMPLETE_REQ_SZ,
.fn = ipa_server_driver_init_complete, .fn = ipa_server_driver_init_complete,
}, },
{ },
}; };
/* Handle an INIT_DRIVER response message from the modem. */ /* Handle an INIT_DRIVER response message from the modem. */
...@@ -269,6 +270,7 @@ static struct qmi_msg_handler ipa_client_msg_handlers[] = { ...@@ -269,6 +270,7 @@ static struct qmi_msg_handler ipa_client_msg_handlers[] = {
.decoded_size = IPA_QMI_INIT_DRIVER_RSP_SZ, .decoded_size = IPA_QMI_INIT_DRIVER_RSP_SZ,
.fn = ipa_client_init_driver, .fn = ipa_client_init_driver,
}, },
{ },
}; };
/* Return a pointer to an init modem driver request structure, which contains /* Return a pointer to an init modem driver request structure, which contains
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册