From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, "David S. Miller" <davem@davemloft.net>,
Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Chris Brandt <chris.brandt@renesas.com>,
netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: sh_eth: fix a missing check of of_get_phy_mode
Date: Tue, 12 Mar 2019 10:31:05 +0300 [thread overview]
Message-ID: <902bc3a0-94b5-cf00-6b41-f2724744fbe6@cogentembedded.com> (raw)
In-Reply-To: <20190312063026.15083-1-kjlu@umn.edu>
Hello!
On 12.03.2019 9:30, Kangjie Lu wrote:
> of_get_phy_mode may fail and return a negative error code;
> the fix checks the return value of of_get_phy_mode and
> returns NULL of it fails.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
> drivers/net/ethernet/renesas/sh_eth.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 239eeafe1b2d..e33af371b169 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -3181,14 +3181,16 @@ static struct sh_eth_plat_data *sh_eth_parse_dt(struct device *dev)
> struct device_node *np = dev->of_node;
> struct sh_eth_plat_data *pdata;
> const char *mac_addr;
> + int ret;
>
> pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> if (!pdata)
> return NULL;
>
> - pdata->phy_interface = of_get_phy_mode(np);
> - if (pdata->phy_interface < 0)
Please generate your patch against the pristine net.git, not atop
of your previous version.
> + ret = of_get_phy_mode(np);
> + if (ret < 0)
> return NULL;
> + pdata->phy_interface = ret;
>
> mac_addr = of_get_mac_address(np);
> if (mac_addr)
>
MBR, Sergei
next prev parent reply other threads:[~2019-03-12 7:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-11 7:49 [PATCH v2] net: renesas: " Kangjie Lu
2019-03-11 10:29 ` Sergei Shtylyov
2019-03-11 17:52 ` David Miller
2019-03-11 17:55 ` Sergei Shtylyov
2019-03-12 6:30 ` [PATCH v2] net: sh_eth: " Kangjie Lu
2019-03-12 7:31 ` Sergei Shtylyov [this message]
2019-03-12 7:43 ` [PATCH v3] " Kangjie Lu
2019-03-12 7:50 ` Sergei Shtylyov
2019-03-12 8:18 ` Geert Uytterhoeven
2019-03-12 21:51 ` David Miller
2019-03-11 10:59 ` [PATCH v2] net: renesas: " Geert Uytterhoeven
2019-03-11 14:18 ` Sergei Shtylyov
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=902bc3a0-94b5-cf00-6b41-f2724744fbe6@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=chris.brandt@renesas.com \
--cc=davem@davemloft.net \
--cc=geert+renesas@glider.be \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pakki001@umn.edu \
--cc=vladimir_zapolskiy@mentor.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 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®