staging: slicoss Check for valid hw address
authorkirjanov@gmail.com <kirjanov@gmail.com>
Fri, 18 Dec 2009 07:52:45 +0000 (10:52 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:28 +0000 (16:42 -0800)
Check for valid hw address.

Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/slicoss/slicoss.c

index a18eeb6..9c8eb09 100644 (file)
@@ -2531,6 +2531,9 @@ static int slic_mac_set_address(struct net_device *dev, void *ptr)
        if (!adapter)
                return -EBUSY;
 
+       if (!is_valid_ether_addr(addr->sa_data))
+               return -EINVAL;
+
        memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
        memcpy(adapter->currmacaddr, addr->sa_data, dev->addr_len);