netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dev@lynxeye.de
Cc: netdev@vger.kernel.org, kernel@pengutronix.de, l.stach@pengutronix.de
Subject: Re: [PATCH] net: fec: make sure to init MAC address
Date: Sat, 29 Mar 2014 18:54:29 -0400 (EDT)	[thread overview]
Message-ID: <20140329.185429.613403614921271282.davem@davemloft.net> (raw)
In-Reply-To: <1396048764-3301-1-git-send-email-dev@lynxeye.de>

From: Lucas Stach <dev@lynxeye.de>
Date: Sat, 29 Mar 2014 00:19:24 +0100

> @@ -1898,10 +1898,11 @@ fec_set_mac_address(struct net_device *ndev, void *p)
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	struct sockaddr *addr = p;
>  
> -	if (!is_valid_ether_addr(addr->sa_data))
> -		return -EADDRNOTAVAIL;
> -
> -	memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
> +	if (p) {
> +		if (!is_valid_ether_addr(addr->sa_data))
> +			return -EADDRNOTAVAIL;
> +		memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
> +	}

This test looks awkward, if we're going to dereference and
use 'addr', then test 'addr' instead of 'p'.

Thanks.

      reply	other threads:[~2014-03-29 22:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 23:19 [PATCH] net: fec: make sure to init MAC address Lucas Stach
2014-03-29 22:54 ` David Miller [this message]

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=20140329.185429.613403614921271282.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dev@lynxeye.de \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --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).