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:33:45 +0000 (09:33 +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 115c0a1..bb91774 100644 (file)
@@ -954,6 +954,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;
        }