]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/ieee80211_rate.c
Driver core: fix class glue dir cleanup logic
[linux-2.6-omap-h63xx.git] / net / mac80211 / ieee80211_rate.c
index 7254bd6098398e0f408afe8f6eff40922dfe3c71..c3f2783937419a8c0afae47b302657288d647184 100644 (file)
@@ -33,6 +33,7 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops)
                if (!strcmp(alg->ops->name, ops->name)) {
                        /* don't register an algorithm twice */
                        WARN_ON(1);
+                       mutex_unlock(&rate_ctrl_mutex);
                        return -EALREADY;
                }
        }
@@ -59,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);