From: Cyrill Gorcunov Date: Fri, 14 Dec 2007 00:17:03 +0000 (-0800) Subject: NET: mac80211: fix inappropriate memory freeing X-Git-Tag: v2.6.24-rc7~54^2~20 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20880e8936e467fe30d79aa838c8d24b7073648f;p=linux-2.6 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: Cyrill Gorcunov Acked-by: Michael Wu Signed-off-by: Andrew Morton Signed-off-by: John W. Linville --- diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c index 3260a4a0ec..c3f2783937 100644 --- a/net/mac80211/ieee80211_rate.c +++ b/net/mac80211/ieee80211_rate.c @@ -60,11 +60,11 @@ void ieee80211_rate_control_unregister(struct rate_control_ops *ops) list_for_each_entry(alg, &rate_ctrl_algs, list) { if (alg->ops == ops) { list_del(&alg->list); + kfree(alg); break; } } mutex_unlock(&rate_ctrl_mutex); - kfree(alg); } EXPORT_SYMBOL(ieee80211_rate_control_unregister);