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 D34EE33F390; Thu, 12 Mar 2026 20:19:30 +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=1773346770; cv=none; b=Zs7Yunanrdz/OZtGBhcocriUvFeTP45g1X68QHOeyUxZ5UXu0BGsZrwrQRjQpqxYGrapaweglZjZVe53WVPfNy0GxcVxKKYSVWKAYdvn3tfs0hGRdS4byF2mAih6oJCzNBXXDr3oImL8jF/vvc8jy3W24emrhyGqVFewUd7WebE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773346770; c=relaxed/simple; bh=KaPMF/yNZKGcnxDETZFKMX6uSDBbbfpo5eivSXABOmc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Id/CiqklcxDTi+4NigN27Sd9+KV6gEr3zNYc6v0E+Gf907kNjD28cKmMGZU+i49NovqNqmnXhfrhbbUyg1B83w7DlDrjKxqNRouaXqTuxRPQENHEjpR62kFriKfuwdW/gif1CFNVgC/j555UBdAwRGkM+/w/MVk8KExh/dr/yBk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fjAyazuK; 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="fjAyazuK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16746C19425; Thu, 12 Mar 2026 20:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773346770; bh=KaPMF/yNZKGcnxDETZFKMX6uSDBbbfpo5eivSXABOmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fjAyazuK3c2kTVNIctP04e5z/iLIdVvnfI1IQS2A5znzPyXyIzpWpRD6P4lOQvk7M qiTyOfQ6CDXB226V1cyReY+Tq2OzkeGPMHNkoQnLLnkWJ5lJzVFZZ1dL4GSfN6QWxy 3GxpEeD2tqNjTNzaEWGvd/0ialPD2PfV93OFWjGg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikko Perttunen , Miaoqian Lin , Johan Hovold , Stephen Boyd , Sasha Levin Subject: [PATCH 6.12 087/265] clk: tegra: tegra124-emc: fix device leak on set_rate() Date: Thu, 12 Mar 2026 21:07:54 +0100 Message-ID: <20260312201021.362359561@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260312201018.128816016@linuxfoundation.org> References: <20260312201018.128816016@linuxfoundation.org> User-Agent: quilt/0.69 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 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold [ Upstream commit da61439c63d34ae6503d080a847f144d587e3a48 ] Make sure to drop the reference taken when looking up the EMC device and its driver data on first set_rate(). Note that holding a reference to a device does not prevent its driver data from going away so there is no point in keeping the reference. Fixes: 2db04f16b589 ("clk: tegra: Add EMC clock driver") Fixes: 6d6ef58c2470 ("clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver") Cc: stable@vger.kernel.org # 4.2: 6d6ef58c2470 Cc: Mikko Perttunen Cc: Miaoqian Lin Signed-off-by: Johan Hovold Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/tegra/clk-tegra124-emc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c index 0f6fb776b2298..5f1af6dfe7154 100644 --- a/drivers/clk/tegra/clk-tegra124-emc.c +++ b/drivers/clk/tegra/clk-tegra124-emc.c @@ -197,8 +197,8 @@ static struct tegra_emc *emc_ensure_emc_driver(struct tegra_clk_emc *tegra) tegra->emc_node = NULL; tegra->emc = platform_get_drvdata(pdev); + put_device(&pdev->dev); if (!tegra->emc) { - put_device(&pdev->dev); pr_err("%s: cannot find EMC driver\n", __func__); return NULL; } -- 2.51.0