Blob Blame History Raw
From db64e7e74bd2abeae58ff65bdf41305f04a60fa1 Mon Sep 17 00:00:00 2001
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Date: Fri, 14 Jan 2022 14:32:59 +0100
Subject: [PATCH] rpmsg: qcom_smd: Fix redundant channel->registered assignment
Git-commit: db64e7e74bd2abeae58ff65bdf41305f04a60fa1
Patch-mainline: v5.18-rc1
References: git-fixes

In qcom_channel_state_worker(), we are setting channel->registered
to true when registering a channel, but this is getting repeated both
before and after re-locking the channels_lock spinlock, which is
obviously a typo.
Remove the assignment done out of the spinlock to fix this redundancy.

Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220114133259.247726-1-angelogioacchino.delregno@collabora.com
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/rpmsg/qcom_smd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 9380eb986a53..595530fcfd7e 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1303,9 +1303,7 @@ static void qcom_channel_state_worker(struct work_struct *work)
 
 		spin_unlock_irqrestore(&edge->channels_lock, flags);
 		qcom_smd_create_device(channel);
-		channel->registered = true;
 		spin_lock_irqsave(&edge->channels_lock, flags);
-
 		channel->registered = true;
 	}
 
-- 
2.31.1