diff options
author | Florian Schilhabel <florian.c.schilhabel@googlemail.com> | 2010-02-19 20:12:12 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 16:43:05 -0800 |
commit | 7bd795bfcd7eb2f2962d458bf787d5ee0d1167cd (patch) | |
tree | 9da40c9fa08178b9e52d4116629032eeda6d988b /drivers/staging | |
parent | a99840b1aa66d3797bfe0be4fb6982bba62d815b (diff) | |
download | linux-7bd795bfcd7eb2f2962d458bf787d5ee0d1167cd.tar.bz2 |
Staging: rtl8192su: use list_for_each_safe() in ieee80211_crypto_deinit
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8192su/TODO | 1 | ||||
-rw-r--r-- | drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c | 19 |
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/rtl8192su/TODO b/drivers/staging/rtl8192su/TODO index f11eec700030..3c8da157a93c 100644 --- a/drivers/staging/rtl8192su/TODO +++ b/drivers/staging/rtl8192su/TODO @@ -4,7 +4,6 @@ TODO: - cleanup ieee80211.h - move rtl8192su's specific code out from ieee80211.h - abstract rtl819su's specific code - - use list_for_each_safe() in ieee80211_crypto_deinit - switch to use shared "librtl" instead of private ieee80211 stack - switch to use LIB80211 - switch to use MAC80211 diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c index 521e7b989934..c4640e63196b 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c @@ -226,19 +226,20 @@ out: void __exit ieee80211_crypto_deinit(void) { struct list_head *ptr, *n; + struct ieee80211_crypto_alg *alg = NULL; if (hcrypt == NULL) return; - for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs; - ptr = n, n = ptr->next) { - struct ieee80211_crypto_alg *alg = - (struct ieee80211_crypto_alg *) ptr; - list_del(ptr); - printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm " - "'%s' (deinit)\n", alg->ops->name); - kfree(alg); + list_for_each_safe(ptr, n, &hcrypt->algs) { + alg = list_entry(ptr, struct ieee80211_crypto_alg, list); + if (alg) { + list_del(ptr); + printk(KERN_DEBUG + "ieee80211_crypt: unregistered algorithm '%s' (deinit)\n", + alg->ops->name); + kfree(alg); + } } - kfree(hcrypt); } |