From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
Vinod Koul <vkoul@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
linux-phy@lists.infradead.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] phy: HiSilicon: Fix copy and paste bug in error handling
Date: Wed, 17 Nov 2021 08:14:56 +0000 [thread overview]
Message-ID: <20211117081456.001af8b3@sal.lan> (raw)
In-Reply-To: <20211117074843.GE5237@kili>
Em Wed, 17 Nov 2021 10:48:43 +0300
Dan Carpenter <dan.carpenter@oracle.com> escreveu:
> This should check ">pmctrl" instead of "->sysctrl". This bug could
> potentially lead to a crash if we dereference the error pointer.
>
> Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> drivers/phy/hisilicon/phy-hi3670-pcie.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/hisilicon/phy-hi3670-pcie.c b/drivers/phy/hisilicon/phy-hi3670-pcie.c
> index c64c6679b1b9..0ac9634b398d 100644
> --- a/drivers/phy/hisilicon/phy-hi3670-pcie.c
> +++ b/drivers/phy/hisilicon/phy-hi3670-pcie.c
> @@ -757,8 +757,8 @@ static int hi3670_pcie_phy_get_resources(struct hi3670_pcie_phy *phy,
> return PTR_ERR(phy->sysctrl);
>
> phy->pmctrl = syscon_regmap_lookup_by_compatible("hisilicon,hi3670-pmctrl");
> - if (IS_ERR(phy->sysctrl))
> - return PTR_ERR(phy->sysctrl);
> + if (IS_ERR(phy->pmctrl))
> + return PTR_ERR(phy->pmctrl);
>
> /* clocks */
> phy->phy_ref_clk = devm_clk_get(dev, "phy_ref");
WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
Vinod Koul <vkoul@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
linux-phy@lists.infradead.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] phy: HiSilicon: Fix copy and paste bug in error handling
Date: Wed, 17 Nov 2021 08:14:56 +0000 [thread overview]
Message-ID: <20211117081456.001af8b3@sal.lan> (raw)
In-Reply-To: <20211117074843.GE5237@kili>
Em Wed, 17 Nov 2021 10:48:43 +0300
Dan Carpenter <dan.carpenter@oracle.com> escreveu:
> This should check ">pmctrl" instead of "->sysctrl". This bug could
> potentially lead to a crash if we dereference the error pointer.
>
> Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> drivers/phy/hisilicon/phy-hi3670-pcie.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/hisilicon/phy-hi3670-pcie.c b/drivers/phy/hisilicon/phy-hi3670-pcie.c
> index c64c6679b1b9..0ac9634b398d 100644
> --- a/drivers/phy/hisilicon/phy-hi3670-pcie.c
> +++ b/drivers/phy/hisilicon/phy-hi3670-pcie.c
> @@ -757,8 +757,8 @@ static int hi3670_pcie_phy_get_resources(struct hi3670_pcie_phy *phy,
> return PTR_ERR(phy->sysctrl);
>
> phy->pmctrl = syscon_regmap_lookup_by_compatible("hisilicon,hi3670-pmctrl");
> - if (IS_ERR(phy->sysctrl))
> - return PTR_ERR(phy->sysctrl);
> + if (IS_ERR(phy->pmctrl))
> + return PTR_ERR(phy->pmctrl);
>
> /* clocks */
> phy->phy_ref_clk = devm_clk_get(dev, "phy_ref");
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2021-11-17 8:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 7:48 [PATCH] phy: HiSilicon: Fix copy and paste bug in error handling Dan Carpenter
2021-11-17 7:48 ` Dan Carpenter
2021-11-17 8:14 ` Mauro Carvalho Chehab [this message]
2021-11-17 8:14 ` Mauro Carvalho Chehab
2021-11-23 5:12 ` Vinod Koul
2021-11-23 5:12 ` 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=20211117081456.001af8b3@sal.lan \
--to=mchehab+huawei@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kishon@ti.com \
--cc=linux-phy@lists.infradead.org \
--cc=mani@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.