rpmsg: glink: Avoid infinite loop on intent for missing channel
authorBjorn Andersson <quic_bjorande@quicinc.com>
Tue, 14 Feb 2023 23:42:31 +0000 (15:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:46 +0000 (09:39 +0100)
[ Upstream commit 3e74ec2f39362bffbd42854acbb67c7f4cb808f9 ]

In the event that an intent advertisement arrives on an unknown channel
the fifo is not advanced, resulting in the same message being handled
over and over.

Fixes: dacbb35e930f ("rpmsg: glink: Receive and store the remote intent buffers")
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: Chris Lew <quic_clew@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230214234231.2069751-1-quic_bjorande@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rpmsg/qcom_glink_native.c

index 13c31372337a2e1065293ba994dd3191b422f1ae..fd4c2f0fa4b1f5f3a0887f1db2b203a2241400ed 100644 (file)
@@ -929,6 +929,7 @@ static void qcom_glink_handle_intent(struct qcom_glink *glink,
        spin_unlock_irqrestore(&glink->idr_lock, flags);
        if (!channel) {
                dev_err(glink->dev, "intents for non-existing channel\n");
+               qcom_glink_rx_advance(glink, ALIGN(msglen, 8));
                return;
        }