summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-02-28 00:49:46 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2009-02-28 00:49:46 (GMT)
commit778ef1e6cbb049c9bcbf405936ee6f2b6e451892 (patch)
tree080232e75f0e138b8642af44b18d296011afdebb /drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
parent3c4f1158cd887a1a8c1309fc6d07907160e8e820 (diff)
parentacfa5110b83b171ec509eaf2d1a9e93a5f4709bd (diff)
downloadlinux-fsl-qoriq-778ef1e6cbb049c9bcbf405936ee6f2b6e451892.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: Staging: w35und: fix usb_control_msg() error handling in wb35_probe() Staging: w35und: fix registration with wlan stack Staging: panel: fix oops on panel_cleanup_module Staging: rtl8187se: Fix oops and memory poison caused by builtin ieee80211. Staging: rtl8187se: fix Kconfig dependencies
Diffstat (limited to 'drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c')
-rw-r--r--drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
index af64cfb..7370296 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
@@ -234,20 +234,21 @@ out:
void 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);
}