Subject: Re: [PATCH] bgmac: validate MAC addr

From: Florian Fainelli <[email-masked]>
Date: Wed, 06 Feb 2013 18:11:41 +0100

Hello Rafal,

On 02/06/2013 10:37 AM, Rafał Miłecki wrote:
>
> Signed-off-by: Rafał Miłecki <[email-masked]>
> ---
>   drivers/net/ethernet/broadcom/bgmac.c |    5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
> index af149a3..9f95089 100644
> --- a/drivers/net/ethernet/broadcom/bgmac.c
> +++ b/drivers/net/ethernet/broadcom/bgmac.c
> @@ -1290,6 +1290,11 @@ static int bgmac_probe(struct bcma_device *core)
>   		return -ENOTSUPP;
>   	}
>
> +	if (!is_valid_ether_addr(mac)) {
> +		dev_err(&core->dev, "Invalid MAC addr: %pM\n", mac);
> +		return -EADDRNOTAVAIL;
> +	}

Rather generate an random one, thus making the interface usable, but 
keep the warning to help users track this down.
--
Florian