Commit 20880e89 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by David S. Miller

NET: mac80211: fix inappropriate memory freeing

Fix inappropriate memory freeing in case of requested rate_control_ops was
not found.  In this case the list head entity is going to be accidentally
wasted.
Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Acked-by: default avatarMichael Wu <flamingice@sourmilk.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3333590e
...@@ -60,11 +60,11 @@ void ieee80211_rate_control_unregister(struct rate_control_ops *ops) ...@@ -60,11 +60,11 @@ void ieee80211_rate_control_unregister(struct rate_control_ops *ops)
list_for_each_entry(alg, &rate_ctrl_algs, list) { list_for_each_entry(alg, &rate_ctrl_algs, list) {
if (alg->ops == ops) { if (alg->ops == ops) {
list_del(&alg->list); list_del(&alg->list);
kfree(alg);
break; break;
} }
} }
mutex_unlock(&rate_ctrl_mutex); mutex_unlock(&rate_ctrl_mutex);
kfree(alg);
} }
EXPORT_SYMBOL(ieee80211_rate_control_unregister); EXPORT_SYMBOL(ieee80211_rate_control_unregister);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment