From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64404134A4 for ; Mon, 12 Jun 2023 10:44:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B84C5C433EF; Mon, 12 Jun 2023 10:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686566690; bh=mVdiv4DOGsBo5Il4XsRzh1KgwunS4LrbSxU3SHXgMwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mhnETqT7a7mGa44mhOjsHXmoH8W/dncWTxhL1Y9lQYRfABdQOjoZUc8d12PyKd3qX S4dLP2NDSDloey8rKn/WBW5kxR3iS96fN5YHUZLuxMike/MGBmacATraoZhkkCicqA 1ES9cdeh0VpoQVjs+613UhA9i9uS+aPtvr6/O9IA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pierre-Louis Bossart , Charles Keepax , Vinod Koul , Sasha Levin Subject: [PATCH 6.1 120/132] soundwire: stream: Add missing clear of alloc_slave_rt Date: Mon, 12 Jun 2023 12:27:34 +0200 Message-ID: <20230612101715.710124097@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612101710.279705932@linuxfoundation.org> References: <20230612101710.279705932@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Charles Keepax [ Upstream commit 58d95889f3c2064c6139ee94bb0e4d86e1ad4eab ] The current path that skips allocating the slave runtime does not clear the alloc_slave_rt flag, this is clearly incorrect. Add the missing clear, so the runtime won't be erroneously cleaned up. Fixes: f3016b891c8c ("soundwire: stream: sdw_stream_add_ functions can be called multiple times") Reviewed-by: Pierre-Louis Bossart Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230602101140.2040141-1-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/soundwire/stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index bd502368339e5..b10ea69a638e1 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -2019,8 +2019,10 @@ int sdw_stream_add_slave(struct sdw_slave *slave, skip_alloc_master_rt: s_rt = sdw_slave_rt_find(slave, stream); - if (s_rt) + if (s_rt) { + alloc_slave_rt = false; goto skip_alloc_slave_rt; + } s_rt = sdw_slave_rt_alloc(slave, m_rt); if (!s_rt) { -- 2.39.2