diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bnad_ethtool.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c index 9b44ec8096ba..803ea32aa99d 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c +++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c | |||
@@ -946,7 +946,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, | |||
946 | 946 | ||
947 | flash_attr = kzalloc(sizeof(struct bfa_flash_attr), GFP_KERNEL); | 947 | flash_attr = kzalloc(sizeof(struct bfa_flash_attr), GFP_KERNEL); |
948 | if (!flash_attr) | 948 | if (!flash_attr) |
949 | return -ENOMEM; | 949 | return 0; |
950 | 950 | ||
951 | fcomp.bnad = bnad; | 951 | fcomp.bnad = bnad; |
952 | fcomp.comp_status = 0; | 952 | fcomp.comp_status = 0; |
@@ -958,7 +958,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, | |||
958 | if (ret != BFA_STATUS_OK) { | 958 | if (ret != BFA_STATUS_OK) { |
959 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 959 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
960 | kfree(flash_attr); | 960 | kfree(flash_attr); |
961 | goto out_err; | 961 | return 0; |
962 | } | 962 | } |
963 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 963 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
964 | wait_for_completion(&fcomp.comp); | 964 | wait_for_completion(&fcomp.comp); |
@@ -978,8 +978,6 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, | |||
978 | } | 978 | } |
979 | kfree(flash_attr); | 979 | kfree(flash_attr); |
980 | return flash_part; | 980 | return flash_part; |
981 | out_err: | ||
982 | return -EINVAL; | ||
983 | } | 981 | } |
984 | 982 | ||
985 | static int | 983 | static int |
@@ -1006,7 +1004,7 @@ bnad_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, | |||
1006 | /* Query the flash partition based on the offset */ | 1004 | /* Query the flash partition based on the offset */ |
1007 | flash_part = bnad_get_flash_partition_by_offset(bnad, | 1005 | flash_part = bnad_get_flash_partition_by_offset(bnad, |
1008 | eeprom->offset, &base_offset); | 1006 | eeprom->offset, &base_offset); |
1009 | if (flash_part <= 0) | 1007 | if (flash_part == 0) |
1010 | return -EFAULT; | 1008 | return -EFAULT; |
1011 | 1009 | ||
1012 | fcomp.bnad = bnad; | 1010 | fcomp.bnad = bnad; |
@@ -1048,7 +1046,7 @@ bnad_set_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, | |||
1048 | /* Query the flash partition based on the offset */ | 1046 | /* Query the flash partition based on the offset */ |
1049 | flash_part = bnad_get_flash_partition_by_offset(bnad, | 1047 | flash_part = bnad_get_flash_partition_by_offset(bnad, |
1050 | eeprom->offset, &base_offset); | 1048 | eeprom->offset, &base_offset); |
1051 | if (flash_part <= 0) | 1049 | if (flash_part == 0) |
1052 | return -EFAULT; | 1050 | return -EFAULT; |
1053 | 1051 | ||
1054 | fcomp.bnad = bnad; | 1052 | fcomp.bnad = bnad; |