lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140329.185429.613403614921271282.davem@davemloft.net>
Date:	Sat, 29 Mar 2014 18:54:29 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	dev@...xeye.de
Cc:	netdev@...r.kernel.org, kernel@...gutronix.de,
	l.stach@...gutronix.de
Subject: Re: [PATCH] net: fec: make sure to init MAC address

From: Lucas Stach <dev@...xeye.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ