]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: terminate message handler arrays
authorAlex Elder <elder@linaro.org>
Fri, 12 Mar 2021 15:12:48 +0000 (09:12 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Mar 2021 22:25:27 +0000 (14:25 -0800)
commit325534b71cae1f8886553f632e41c9e9eec70356
tree3a1a39c54bae53e58a235445cd17dc31f8a0b6d5
parenta3437f953eb34a0fabeaf91c6d24f9d101c590e4
net: ipa: terminate message handler arrays

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: 8b29b90afdb07 ("soc: qcom: ipa: AP/modem communications")
Reported-by: Sujit Kautkar <sujitka@chromium.org>
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_qmi.c