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 57F7E14037E; Tue, 27 Feb 2024 14:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709044092; cv=none; b=aEk8O/SZ2sQjlyONhc64OOXFKBw/+n5Be9hjm/LVjs6+8M4SeJRFs4OQTS9NzrB1dMtyLVVqryQ83e3SPtqiKJbO84IB3B+8ecmc+htBDftlC5+92/TSRyPu3YAnfiXgyBuaty8jpRTgmuQFIvyJ8CCsj5V4ptry8fm9uGmfOjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709044092; c=relaxed/simple; bh=oHfnojN0JdqDJc8T1HfWiaLv1veTeq0B6Y2eug0hlQQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rl3ssbE1qbn9KxmO3zdFkRNj3a/5EoBrbgzaO4TZdpI/w8ccge1csE8EZUxUtgFU+V/m4bqWBXo4ZoZLuCMUp7wG2k0y8yH8sSWTewB8zXJTClg0CTt4VGhk6BF0YXs9PXu+152TRgVFTuv/Bn802jBJi+AgIXTvNUkcEogPLUQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=D+nk6GzF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="D+nk6GzF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D594EC433C7; Tue, 27 Feb 2024 14:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709044092; bh=oHfnojN0JdqDJc8T1HfWiaLv1veTeq0B6Y2eug0hlQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D+nk6GzFTuulll1P9eVICXV4S1t2QD+P/MqVblkWNNHw/iLDWhpT1lzkE3vZTQGdi eKgQBZWuSmS+XcJYxO32DpOOaYt827DOuvHOf6hOVphTaHHAjnlk7R8iQoCkzw64D3 YkNWPvo7XX+O1u3WZihv6rc/bA/2nJphh4D3uBPA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andy Shevchenko , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.10 059/122] ASoC: Intel: bytcr_rt5651: Drop reference count of ACPI device after use Date: Tue, 27 Feb 2024 14:27:00 +0100 Message-ID: <20240227131600.637492789@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240227131558.694096204@linuxfoundation.org> References: <20240227131558.694096204@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Shevchenko [ Upstream commit 721858823d7cdc8f2a897579b040e935989f6f02 ] Theoretically the device might gone if its reference count drops to 0. This might be the case when we try to find the first physical node of the ACPI device. We need to keep reference to it until we get a result of the above mentioned call. Refactor the code to drop the reference count at the correct place. While at it, move to acpi_dev_put() as symmetrical call to the acpi_dev_get_first_match_dev(). Fixes: 02c0a3b3047f ("ASoC: Intel: bytcr_rt5651: add MCLK, quirks and cleanups") Signed-off-by: Andy Shevchenko Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230112112852.67714-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/boards/bytcr_rt5651.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index 472f6e3327960..a8289f74463e9 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -919,7 +919,6 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) if (adev) { snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name), "i2c-%s", acpi_dev_name(adev)); - put_device(&adev->dev); byt_rt5651_dais[dai_index].codecs->name = byt_rt5651_codec_name; } else { dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); @@ -927,6 +926,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) } codec_dev = acpi_get_first_physical_node(adev); + acpi_dev_put(adev); if (!codec_dev) return -EPROBE_DEFER; priv->codec_dev = get_device(codec_dev); -- 2.43.0