NET: nl80211, fix lock imbalance and netdev referencing
authorJiri Slaby <jirislaby@gmail.com>
Wed, 7 Jul 2010 13:02:46 +0000 (15:02 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Jul 2010 19:48:18 +0000 (15:48 -0400)
Stanse found that nl80211_set_wiphy imporperly handles a lock and netdev
reference and contains unreachable code. It is because there return statement
isntead of assignment to result variable. Fix that.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jouni Malinen <j@w1.fi>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/nl80211.c

index a999fc154623783c453f6625f186d47a386fe101..cea595e2ed4dbd6bf435764760c9810d18ffec41 100644 (file)
@@ -877,7 +877,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
                int idx, mbm = 0;
 
                if (!rdev->ops->set_tx_power) {
-                       return -EOPNOTSUPP;
+                       result = -EOPNOTSUPP;
                        goto bad_res;
                }