From: Arend van Spriel Date: Sun, 2 Oct 2011 17:14:34 +0000 (-0700) Subject: staging: brcm80211: only allow one call to add_interface callback X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=683fbb42396106974c315897d8d379f9e7b8ee40;p=openwrt%2Fstaging%2Fblogic.git staging: brcm80211: only allow one call to add_interface callback 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 Reviewed-by: Roland Vossen Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Franky Lin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c index 1fa95d71973c..6787498cb04d 100644 --- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c @@ -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)