aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/enic_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/enic/enic_dev.c')
-rw-r--r--drivers/net/enic/enic_dev.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/enic/enic_dev.c b/drivers/net/enic/enic_dev.c
index a52dbd2b3c63..382626628b1b 100644
--- a/drivers/net/enic/enic_dev.c
+++ b/drivers/net/enic/enic_dev.c
@@ -49,26 +49,28 @@ int enic_dev_stats_dump(struct enic *enic, struct vnic_stats **vstats)
49 49
50int enic_dev_add_station_addr(struct enic *enic) 50int enic_dev_add_station_addr(struct enic *enic)
51{ 51{
52 int err = 0; 52 int err;
53
54 if (!is_valid_ether_addr(enic->netdev->dev_addr))
55 return -EADDRNOTAVAIL;
53 56
54 if (is_valid_ether_addr(enic->netdev->dev_addr)) { 57 spin_lock(&enic->devcmd_lock);
55 spin_lock(&enic->devcmd_lock); 58 err = vnic_dev_add_addr(enic->vdev, enic->netdev->dev_addr);
56 err = vnic_dev_add_addr(enic->vdev, enic->netdev->dev_addr); 59 spin_unlock(&enic->devcmd_lock);
57 spin_unlock(&enic->devcmd_lock);
58 }
59 60
60 return err; 61 return err;
61} 62}
62 63
63int enic_dev_del_station_addr(struct enic *enic) 64int enic_dev_del_station_addr(struct enic *enic)
64{ 65{
65 int err = 0; 66 int err;
67
68 if (!is_valid_ether_addr(enic->netdev->dev_addr))
69 return -EADDRNOTAVAIL;
66 70
67 if (is_valid_ether_addr(enic->netdev->dev_addr)) { 71 spin_lock(&enic->devcmd_lock);
68 spin_lock(&enic->devcmd_lock); 72 err = vnic_dev_del_addr(enic->vdev, enic->netdev->dev_addr);
69 err = vnic_dev_del_addr(enic->vdev, enic->netdev->dev_addr); 73 spin_unlock(&enic->devcmd_lock);
70 spin_unlock(&enic->devcmd_lock);
71 }
72 74
73 return err; 75 return err;
74} 76}