Commit 115d56f7 authored by Vasanthy Kolluri's avatar Vasanthy Kolluri Committed by David S. Miller

enic: Bug Fix: Fix return values of enic_add/del_station_addr routines

Fix enic_add/del_station_addr routines to return appropriate error code when an invalid address is added or deleted.
Signed-off-by: default avatarChristian Benvenuti <benve@cisco.com>
Signed-off-by: default avatarVasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: default avatarRoopa Prabhu <roprabhu@cisco.com>
Signed-off-by: default avatarDavid Wang <dwang2@cisco.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51987461
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define DRV_NAME "enic" #define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
#define DRV_VERSION "2.1.1.3" #define DRV_VERSION "2.1.1.4"
#define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc" #define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc"
#define ENIC_BARS_MAX 6 #define ENIC_BARS_MAX 6
......
...@@ -49,26 +49,28 @@ int enic_dev_stats_dump(struct enic *enic, struct vnic_stats **vstats) ...@@ -49,26 +49,28 @@ int enic_dev_stats_dump(struct enic *enic, struct vnic_stats **vstats)
int enic_dev_add_station_addr(struct enic *enic) int enic_dev_add_station_addr(struct enic *enic)
{ {
int err = 0; int err;
if (!is_valid_ether_addr(enic->netdev->dev_addr))
return -EADDRNOTAVAIL;
if (is_valid_ether_addr(enic->netdev->dev_addr)) {
spin_lock(&enic->devcmd_lock); spin_lock(&enic->devcmd_lock);
err = vnic_dev_add_addr(enic->vdev, enic->netdev->dev_addr); err = vnic_dev_add_addr(enic->vdev, enic->netdev->dev_addr);
spin_unlock(&enic->devcmd_lock); spin_unlock(&enic->devcmd_lock);
}
return err; return err;
} }
int enic_dev_del_station_addr(struct enic *enic) int enic_dev_del_station_addr(struct enic *enic)
{ {
int err = 0; int err;
if (!is_valid_ether_addr(enic->netdev->dev_addr))
return -EADDRNOTAVAIL;
if (is_valid_ether_addr(enic->netdev->dev_addr)) {
spin_lock(&enic->devcmd_lock); spin_lock(&enic->devcmd_lock);
err = vnic_dev_del_addr(enic->vdev, enic->netdev->dev_addr); err = vnic_dev_del_addr(enic->vdev, enic->netdev->dev_addr);
spin_unlock(&enic->devcmd_lock); spin_unlock(&enic->devcmd_lock);
}
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment