staging: brcm80211: only allow one call to add_interface callback
authorArend van Spriel <arend@broadcom.com>
Sun, 2 Oct 2011 17:14:34 +0000 (10:14 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 23:16:48 +0000 (16:16 -0700)
The driver only supports one network interface to be associated
with it. Only for the first call it does actually something. For
subsequent calls it does return -ENODEV error code.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/mac80211_if.c

index 1fa95d71973c6c50ab0dc90237cd9bb701df7ac5..6787498cb04d3a7a09c2cba0b0350b76948f0195 100644 (file)
@@ -341,7 +341,10 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 
        wl = hw->priv;
        LOCK(wl);
-       err = brcms_up(wl);
+       if (!wl->pub->up)
+               err = brcms_up(wl);
+       else
+               err = -ENODEV;
        UNLOCK(wl);
 
        if (err != 0)