The present check denies the IBSS interface addtion if we
already have any other vifs. But it fails to deny interface
addition if IBSS was already present.
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
                }
        }
 
-       if ((vif->type == NL80211_IFTYPE_ADHOC) &&
-           sc->nvifs > 0) {
+       if ((ah->opmode == NL80211_IFTYPE_ADHOC) ||
+           ((vif->type == NL80211_IFTYPE_ADHOC) &&
+            sc->nvifs > 0)) {
                ath_err(common, "Cannot create ADHOC interface when other"
                        " interfaces already exist.\n");
                ret = -EINVAL;