mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	tomi.valkeinen@ideasonboard.com, vkoul@kernel.org,
	neil.armstrong@linaro.org
Cc: linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, git@amd.com
Subject: Re: [PATCH 2/2] phy: zynqmp: fix runtime PM leak on probe allocation failure
Date: Tue, 21 Jul 2026 07:39:28 +0200	[thread overview]
Message-ID: <7b9c645f-145c-4703-b8ed-13f5303e2a4e@amd.com> (raw)
In-Reply-To: <20260720153832.1130006-3-radhey.shyam.pandey@amd.com>



On 7/20/26 17:38, Radhey Shyam Pandey wrote:
> 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 <radhey.shyam.pandey@amd.com>
> ---
>   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 c8230f2bda62..2138f5399821 100644
> --- a/drivers/phy/xilinx/phy-zynqmp.c
> +++ b/drivers/phy/xilinx/phy-zynqmp.c
> @@ -1044,6 +1044,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);
>   
> @@ -1053,12 +1059,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;
>   }
>   

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

  reply	other threads:[~2026-07-21  5:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 15:38 [PATCH 0/2] phy: zynqmp: fix clock and runtime PM error paths in xpsgtr driver Radhey Shyam Pandey
2026-07-20 15:38 ` [PATCH 1/2] phy: zynqmp: fix clock error handling in xpsgtr_phy_init() Radhey Shyam Pandey
2026-07-21  5:39   ` Michal Simek
2026-07-20 15:38 ` [PATCH 2/2] phy: zynqmp: fix runtime PM leak on probe allocation failure Radhey Shyam Pandey
2026-07-21  5:39   ` Michal Simek [this message]
2026-07-22  8:33 ` [PATCH 0/2] phy: zynqmp: fix clock and runtime PM error paths in xpsgtr driver Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b9c645f-145c-4703-b8ed-13f5303e2a4e@amd.com \
    --to=michal.simek@amd.com \
    --cc=git@amd.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®