diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a999fc154623783c453f6625f186d47a386fe101..cea595e2ed4dbd6bf435764760c9810d18ffec41 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -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;
 		}