From: Colin Foster <colin.foster@in-advantage.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: vkoul@kernel.org, kishon@kernel.org, linus.walleij@linaro.org,
treding@nvidia.com, florian.fainelli@broadcom.com,
krzysztof.kozlowski@linaro.org, davem@davemloft.net,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: ocelot-serdes: Fix IS_ERR vs NULL bug in serdes_probe()
Date: Thu, 31 Oct 2024 09:31:11 -0500 [thread overview]
Message-ID: <ZyOUr7iDa9nFBxgq@colin-ia-desktop> (raw)
In-Reply-To: <20241031123847.1356808-1-ruanjinjie@huawei.com>
On Thu, Oct 31, 2024 at 08:38:47PM +0800, Jinjie Ruan wrote:
> dev_get_regmap() return NULL and never return ERR_PTR().
> check NULL to fix it.
>
> Cc: stable@vger.kernel.org
> Fixes: 672faa7bbf60 ("phy: phy-ocelot-serdes: add ability to be used in a non-syscon configuration")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> drivers/phy/mscc/phy-ocelot-serdes.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/mscc/phy-ocelot-serdes.c b/drivers/phy/mscc/phy-ocelot-serdes.c
> index 1cd1b5db2ad7..77ca67ce6e91 100644
> --- a/drivers/phy/mscc/phy-ocelot-serdes.c
> +++ b/drivers/phy/mscc/phy-ocelot-serdes.c
> @@ -512,8 +512,8 @@ static int serdes_probe(struct platform_device *pdev)
> res->name);
> }
>
> - if (IS_ERR(ctrl->regs))
> - return PTR_ERR(ctrl->regs);
> + if (!ctrl->regs)
> + return -EINVAL;
>
> for (i = 0; i < SERDES_MAX; i++) {
> ret = serdes_phy_create(ctrl, i, &ctrl->phys[i]);
> --
> 2.34.1
>
Good find.
Acked-by: colin.foster@in-advantage.com
Revieved-by: colin.foster@in-advantage.com
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2024-10-31 14:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 12:38 [PATCH] phy: ocelot-serdes: Fix IS_ERR vs NULL bug in serdes_probe() Jinjie Ruan
2024-10-31 14:31 ` Colin Foster [this message]
2024-10-31 17:15 ` Markus Elfring
2024-10-31 17:46 ` Colin Foster
2024-10-31 18:09 ` Markus Elfring
2024-10-31 18:22 ` Colin Foster
2024-10-31 16:59 ` [PATCH] " Markus Elfring
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=ZyOUr7iDa9nFBxgq@colin-ia-desktop \
--to=colin.foster@in-advantage.com \
--cc=davem@davemloft.net \
--cc=florian.fainelli@broadcom.com \
--cc=kishon@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=ruanjinjie@huawei.com \
--cc=treding@nvidia.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