Commit 339d244a authored by Leo Kim's avatar Leo Kim Committed by Greg Kroah-Hartman

staging: wilc1000: remove goto from mac_open

This patch removes goto from mac_open function. If address is invalid, goto
handles deinit process and return result.
So, just call deinit process and return the error value directly instead of
goto statement.
Signed-off-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6bc72c5a
...@@ -1124,8 +1124,9 @@ int mac_open(struct net_device *ndev) ...@@ -1124,8 +1124,9 @@ int mac_open(struct net_device *ndev)
if (!is_valid_ether_addr(ndev->dev_addr)) { if (!is_valid_ether_addr(ndev->dev_addr)) {
PRINT_ER("Error: Wrong MAC address\n"); PRINT_ER("Error: Wrong MAC address\n");
ret = -EINVAL; wilc_deinit_host_int(ndev);
goto _err_; wilc1000_wlan_deinit(ndev);
return -EINVAL;
} }
wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy, wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy,
...@@ -1140,11 +1141,6 @@ int mac_open(struct net_device *ndev) ...@@ -1140,11 +1141,6 @@ int mac_open(struct net_device *ndev)
wl->open_ifcs++; wl->open_ifcs++;
nic->mac_opened = 1; nic->mac_opened = 1;
return 0; return 0;
_err_:
wilc_deinit_host_int(ndev);
wilc1000_wlan_deinit(ndev);
return ret;
} }
struct net_device_stats *mac_stats(struct net_device *dev) struct net_device_stats *mac_stats(struct net_device *dev)
......
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