From: Niklas Cassel <niklas.cassel@linaro.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>, Jose Abreu <joabreu@synopsys.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next] net: stmmac: Fix return value check in qcom_ethqos_probe()
Date: Wed, 23 Jan 2019 10:39:15 +0000 [thread overview]
Message-ID: <20190123103915.GA20558@centauri.lan> (raw)
In-Reply-To: <1548224358-83281-1-git-send-email-weiyongjun1@huawei.com>
On Wed, Jan 23, 2019 at 06:19:18AM +0000, Wei Yongjun wrote:
> In case of error, the function devm_clk_get() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
>
> Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 30724bd..7ec8954 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -473,8 +473,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
> ethqos->por = of_device_get_match_data(&pdev->dev);
>
> ethqos->rgmii_clk = devm_clk_get(&pdev->dev, "rgmii");
> - if (!ethqos->rgmii_clk) {
> - ret = -ENOMEM;
> + if (IS_ERR(ethqos->rgmii_clk)) {
> + ret = PTR_ERR(ethqos->rgmii_clk);
> goto err_mem;
> }
>
>
>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
WARNING: multiple messages have this Message-ID (diff)
From: Niklas Cassel <niklas.cassel@linaro.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>, Jose Abreu <joabreu@synopsys.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next] net: stmmac: Fix return value check in qcom_ethqos_probe()
Date: Wed, 23 Jan 2019 11:39:15 +0100 [thread overview]
Message-ID: <20190123103915.GA20558@centauri.lan> (raw)
In-Reply-To: <1548224358-83281-1-git-send-email-weiyongjun1@huawei.com>
On Wed, Jan 23, 2019 at 06:19:18AM +0000, Wei Yongjun wrote:
> In case of error, the function devm_clk_get() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
>
> Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 30724bd..7ec8954 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -473,8 +473,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
> ethqos->por = of_device_get_match_data(&pdev->dev);
>
> ethqos->rgmii_clk = devm_clk_get(&pdev->dev, "rgmii");
> - if (!ethqos->rgmii_clk) {
> - ret = -ENOMEM;
> + if (IS_ERR(ethqos->rgmii_clk)) {
> + ret = PTR_ERR(ethqos->rgmii_clk);
> goto err_mem;
> }
>
>
>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Niklas Cassel <niklas.cassel@linaro.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
Jose Abreu <joabreu@synopsys.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH net-next] net: stmmac: Fix return value check in qcom_ethqos_probe()
Date: Wed, 23 Jan 2019 11:39:15 +0100 [thread overview]
Message-ID: <20190123103915.GA20558@centauri.lan> (raw)
In-Reply-To: <1548224358-83281-1-git-send-email-weiyongjun1@huawei.com>
On Wed, Jan 23, 2019 at 06:19:18AM +0000, Wei Yongjun wrote:
> In case of error, the function devm_clk_get() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
>
> Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 30724bd..7ec8954 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -473,8 +473,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
> ethqos->por = of_device_get_match_data(&pdev->dev);
>
> ethqos->rgmii_clk = devm_clk_get(&pdev->dev, "rgmii");
> - if (!ethqos->rgmii_clk) {
> - ret = -ENOMEM;
> + if (IS_ERR(ethqos->rgmii_clk)) {
> + ret = PTR_ERR(ethqos->rgmii_clk);
> goto err_mem;
> }
>
>
>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
next prev parent reply other threads:[~2019-01-23 10:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 6:19 [PATCH net-next] net: stmmac: Fix return value check in qcom_ethqos_probe() Wei Yongjun
2019-01-23 6:19 ` Wei Yongjun
2019-01-23 6:19 ` Wei Yongjun
2019-01-23 8:30 ` Vinod Koul
2019-01-23 8:42 ` Vinod Koul
2019-01-23 8:30 ` Vinod Koul
2019-01-23 10:39 ` Niklas Cassel [this message]
2019-01-23 10:39 ` Niklas Cassel
2019-01-23 10:39 ` Niklas Cassel
2019-01-25 6:13 ` David Miller
2019-01-25 6:13 ` David Miller
2019-01-25 6:13 ` David Miller
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=20190123103915.GA20558@centauri.lan \
--to=niklas.cassel@linaro.org \
--cc=alexandre.torgue@st.com \
--cc=joabreu@synopsys.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=vkoul@kernel.org \
--cc=weiyongjun1@huawei.com \
/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.