linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Nicolas.Ferre@microchip.com>
To: <antoine.tenart@bootlin.com>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<Ludovic.Desroches@microchip.com>,
	<alexandre.belloni@bootlin.com>
Subject: Re: [PATCH net] net: macb: do not copy the mac address if NULL
Date: Mon, 24 Jun 2019 15:55:41 +0000	[thread overview]
Message-ID: <0dceaf8f-0a08-8515-5054-1f9395e9b60f@microchip.com> (raw)
In-Reply-To: <20190621152635.29689-1-antoine.tenart@bootlin.com>

On 21/06/2019 at 17:26, Antoine Tenart wrote:
> This patch fixes the MAC address setup in the probe. The MAC address
> retrieved using of_get_mac_address was checked for not containing an
> error, but it may also be NULL which wasn't tested. Fix it by replacing
> IS_ERR with IS_ERR_OR_NULL.
> 
> Fixes: 541ddc66d665 ("net: macb: support of_get_mac_address new ERR_PTR error")
> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

It could be good to have this fix for 5.2-final...

Thanks!

> ---
>   drivers/net/ethernet/cadence/macb_main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 1241a2a73438..1cd1f2c36d6f 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4304,7 +4304,7 @@ static int macb_probe(struct platform_device *pdev)
>   	if (PTR_ERR(mac) == -EPROBE_DEFER) {
>   		err = -EPROBE_DEFER;
>   		goto err_out_free_netdev;
> -	} else if (!IS_ERR(mac)) {
> +	} else if (!IS_ERR_OR_NULL(mac)) {
>   		ether_addr_copy(bp->dev->dev_addr, mac);
>   	} else {
>   		macb_get_hwaddr(bp);
> 


-- 
Nicolas Ferre

  reply	other threads:[~2019-06-24 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 15:26 [PATCH net] net: macb: do not copy the mac address if NULL Antoine Tenart
2019-06-24 15:55 ` Nicolas.Ferre [this message]
2019-06-24 15:57 ` 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=0dceaf8f-0a08-8515-5054-1f9395e9b60f@microchip.com \
    --to=nicolas.ferre@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).