Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C5F513E025C; Mon, 17 Aug 2026 14:33:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786977215; cv=none; b=mNvjPG75qdLccCoUxbqtgc2Cuu6xTlEsH7PdyVHXu1LmnO6VL4SURGdTbiLokNBQMXXeO/71F3dLze7j/reJRR0yO89P/p9Yd83mB4lDPkHASQ1Q5k0MQ3Dk67c170JSb1a8VCOIlG9/GFhePgR4ptZQZmxRVSIiDkcqYY/cuVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786977215; c=relaxed/simple; bh=G+en5KtKC2mcNQNKvKEtebXO7ltDgRdTUgzgvgoVfz0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I/86bjrcHt9nYB3ceW8VMeNVh7uZDfjpAnG87H5nuFELZqRDJZmNv2Re/wquR3YXPxYZL7QXXQB0AWcAa7oCce3Da2bA3TkbUCpmC1EDen1gfH+8Jmml37lM8/a3WSVfJd9AW57I/qt9Z1kkyhYmmJ+77ZruDEgmAvIx97HIDMI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WZSWwHBK; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WZSWwHBK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E64D31F000E9; Mon, 17 Aug 2026 14:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786977214; bh=/1nFNv3WgPyBCfL+s1crK40eiGWWNdeQVPLWW5QJ5Bw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WZSWwHBKSsTqNvdrm9cZvWZAbYhA34UEeHYm53MmqHH1ovWoDsCHwOMi99mpYfgwf rn0xHrQrDR2AqXyIEYW4XKZyAM789OcEqVCPwqzcivRdYk/LHMx3hDl0VG94J4yHD8 RS84MYEt9E99HymzGslcwA5H9aJ2+fWA7IPhDdOQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Radhey Shyam Pandey , Michal Simek , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 252/456] phy: zynqmp: fix runtime PM leak on probe allocation failure Date: Mon, 17 Aug 2026 15:30:42 +0200 Message-ID: <20260817132549.918333409@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132539.792407575@linuxfoundation.org> References: <20260817132539.792407575@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Radhey Shyam Pandey [ Upstream commit f3506e15cf72e94f62d5f2d173e5b7008f644cde ] Allocate saved_regs before pm_runtime_resume_and_get() so a devm_kmalloc() failure does not leave an unreleased runtime PM usage counter. Fixes: 5af9b304bc60 ("phy: xilinx: phy-zynqmp: Fix SGMII linkup failure on resume") Signed-off-by: Radhey Shyam Pandey Reviewed-by: Michal Simek Link: https://patch.msgid.link/20260720153832.1130006-3-radhey.shyam.pandey@amd.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/xilinx/phy-zynqmp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/phy/xilinx/phy-zynqmp.c b/drivers/phy/xilinx/phy-zynqmp.c index 4048aff0798ec..b1bbc859b6ccb 100644 --- a/drivers/phy/xilinx/phy-zynqmp.c +++ b/drivers/phy/xilinx/phy-zynqmp.c @@ -1045,6 +1045,12 @@ static int xpsgtr_probe(struct platform_device *pdev) return PTR_ERR(provider); } + gtr_dev->saved_regs = devm_kmalloc(gtr_dev->dev, + sizeof(save_reg_address), + GFP_KERNEL); + if (!gtr_dev->saved_regs) + return -ENOMEM; + pm_runtime_set_active(gtr_dev->dev); pm_runtime_enable(gtr_dev->dev); @@ -1054,12 +1060,6 @@ static int xpsgtr_probe(struct platform_device *pdev) return ret; } - gtr_dev->saved_regs = devm_kmalloc(gtr_dev->dev, - sizeof(save_reg_address), - GFP_KERNEL); - if (!gtr_dev->saved_regs) - return -ENOMEM; - return 0; } -- 2.53.0