]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
cfg80211: check iface combinations only when iface is running
authorMichal Kazior <michal.kazior@tieto.com>
Fri, 8 Jun 2012 08:55:44 +0000 (10:55 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Sat, 9 Jun 2012 08:31:56 +0000 (10:31 +0200)
Don't validate interface combinations on a stopped
interface. Otherwise we might end up being able to
create a new interface with a certain type, but
won't be able to change an existing interface
into that type.

This also skips some other functions when
interface is stopped and changing interface type.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/util.c

index 8f2d68fc3a444b3c90a699d29d50bf5e48cbb31f..316cfd00914fe8df7d6510b13aeaf4165a9d6d88 100644 (file)
@@ -804,7 +804,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
             ntype == NL80211_IFTYPE_P2P_CLIENT))
                return -EBUSY;
 
-       if (ntype != otype) {
+       if (ntype != otype && netif_running(dev)) {
                err = cfg80211_can_change_interface(rdev, dev->ieee80211_ptr,
                                                    ntype);
                if (err)