staging: wilc1000: remove goto from mac_open
authorLeo Kim <leo.kim@atmel.com>
Thu, 5 Nov 2015 05:36:34 +0000 (14:36 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Nov 2015 04:02:47 +0000 (20:02 -0800)
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: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan.c

index 3c8155ec657c91d49a1aa521cbed75ec428c9396..6492103f6bb19121c850ae13c808b40edc2b2e6a 100644 (file)
@@ -1124,8 +1124,9 @@ int mac_open(struct net_device *ndev)
 
        if (!is_valid_ether_addr(ndev->dev_addr)) {
                PRINT_ER("Error: Wrong MAC address\n");
-               ret = -EINVAL;
-               goto _err_;
+               wilc_deinit_host_int(ndev);
+               wilc1000_wlan_deinit(ndev);
+               return -EINVAL;
        }
 
        wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy,
@@ -1140,11 +1141,6 @@ int mac_open(struct net_device *ndev)
        wl->open_ifcs++;
        nic->mac_opened = 1;
        return 0;
-
-_err_:
-       wilc_deinit_host_int(ndev);
-       wilc1000_wlan_deinit(ndev);
-       return ret;
 }
 
 struct net_device_stats *mac_stats(struct net_device *dev)
This page took 0.025721 seconds and 5 git commands to generate.