mac80211: mesh hwmp locking fixes
This fixes missing unlocks noticed by sparse.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 9a501aa..c2f40ef 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -264,8 +264,10 @@
rcu_read_lock();
sta = sta_info_get(local, mgmt->sa);
- if (!sta)
+ if (!sta) {
+ rcu_read_unlock();
return 0;
+ }
last_hop_metric = airtime_link_metric_get(local, sta);
/* Update and check originator routing info */
@@ -293,6 +295,7 @@
break;
default:
sta_info_put(sta);
+ rcu_read_unlock();
return 0;
}
new_metric = orig_metric + last_hop_metric;