From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 490A1E7C4EB for ; Wed, 4 Oct 2023 18:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244007AbjJDS0w (ORCPT ); Wed, 4 Oct 2023 14:26:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244196AbjJDS0X (ORCPT ); Wed, 4 Oct 2023 14:26:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69243DC for ; Wed, 4 Oct 2023 11:26:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7D13C433C7; Wed, 4 Oct 2023 18:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696443979; bh=5ZaiL8fiBdJUVbeOUtO50b90o4+VuKYQmnvNLDnSa3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v80ltUuSR1WBcyF+EuyEmvNVZspNaVZMQriPhRlbxn4OYvZZIUK5m8jbFPtAnqdt3 +b31PHAypwH4KyIuMnfxhvIyVKj2ZjOyM+LFp6aZwIqNJLll0bB8MQBMaFM7W2xTHz mJf31wL0avJ/89QLZoNhhHW6GRtQC5LSn3GrDaeo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peter Ujfalusi , Bard Liao , Pierre-Louis Bossart , Ranjani Sridharan , Rander Wang , Mark Brown , Sasha Levin Subject: [PATCH 6.5 059/321] ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful Date: Wed, 4 Oct 2023 19:53:24 +0200 Message-ID: <20231004175231.903994587@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231004175229.211487444@linuxfoundation.org> References: <20231004175229.211487444@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Ujfalusi [ Upstream commit 31bb7bd9ffee50d09ec931998b823a86132ab807 ] All the fail paths during probe will free up the ops, on remove we should only free it if the probe was successful. Fixes: bc433fd76fae ("ASoC: SOF: Add ops_free") Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20230915124015.19637-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sof/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 30db685cc5f4b..2d1616b81485c 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -486,10 +486,9 @@ int snd_sof_device_remove(struct device *dev) snd_sof_ipc_free(sdev); snd_sof_free_debug(sdev); snd_sof_remove(sdev); + sof_ops_free(sdev); } - sof_ops_free(sdev); - /* release firmware */ snd_sof_fw_unload(sdev); -- 2.40.1