diff options
author | leandro Costantino <lcostantino@gmail.com> | 2009-02-17 11:16:26 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-27 15:56:23 -0500 |
commit | 096c55d1de39c0de526dfeb8a68ba3b0200e5a93 (patch) | |
tree | 4d56827dcd1a7188c261408d2a881f58d05a52f3 | |
parent | 69e09c983e92cc8f4ebb9f145ba3b460f6374558 (diff) |
Staging: rtl8187se: Fix oops and memory poison caused by builtin ieee80211.
when modprobe and removing rtl8187se ( just for testing, i do not have
that card , and oops and a memory poison error happens on the builtin
ieee80211 of that driver. I dont know if they will port it to the
current ieeee80221 instead of the builtin ones, but just in case i
attach a proposed fix for that problem.
- Change for loop on ieee80211_crypto_deinit for list_for_each_safe to
remove items. Is there an spinlock needed here?
- Call ieee80211_crypto_deinit after exiting all registerd crypto protocols.
Signed-off-by: Costantino Leandro <lcostantino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c | 19 | ||||
-rw-r--r-- | drivers/staging/rtl8187se/r8180_core.c | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c index af64cfbe16db..7370296225e1 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c | |||
@@ -234,20 +234,21 @@ out: | |||
234 | void ieee80211_crypto_deinit(void) | 234 | void ieee80211_crypto_deinit(void) |
235 | { | 235 | { |
236 | struct list_head *ptr, *n; | 236 | struct list_head *ptr, *n; |
237 | struct ieee80211_crypto_alg *alg = NULL; | ||
237 | 238 | ||
238 | if (hcrypt == NULL) | 239 | if (hcrypt == NULL) |
239 | return; | 240 | return; |
240 | 241 | ||
241 | for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs; | 242 | list_for_each_safe(ptr, n, &hcrypt->algs) { |
242 | ptr = n, n = ptr->next) { | 243 | alg = list_entry(ptr, struct ieee80211_crypto_alg, list); |
243 | struct ieee80211_crypto_alg *alg = | 244 | if (alg) { |
244 | (struct ieee80211_crypto_alg *) ptr; | 245 | list_del(ptr); |
245 | list_del(ptr); | 246 | printk(KERN_DEBUG |
246 | printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm " | 247 | "ieee80211_crypt: unregistered algorithm '%s' (deinit)\n", |
247 | "'%s' (deinit)\n", alg->ops->name); | 248 | alg->ops->name); |
248 | kfree(alg); | 249 | kfree(alg); |
250 | } | ||
249 | } | 251 | } |
250 | |||
251 | kfree(hcrypt); | 252 | kfree(hcrypt); |
252 | } | 253 | } |
253 | 254 | ||
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index 94534955e38b..66de5cc8ddf1 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c | |||
@@ -6161,10 +6161,10 @@ static void __exit rtl8180_pci_module_exit(void) | |||
6161 | { | 6161 | { |
6162 | pci_unregister_driver (&rtl8180_pci_driver); | 6162 | pci_unregister_driver (&rtl8180_pci_driver); |
6163 | rtl8180_proc_module_remove(); | 6163 | rtl8180_proc_module_remove(); |
6164 | ieee80211_crypto_deinit(); | ||
6165 | ieee80211_crypto_tkip_exit(); | 6164 | ieee80211_crypto_tkip_exit(); |
6166 | ieee80211_crypto_ccmp_exit(); | 6165 | ieee80211_crypto_ccmp_exit(); |
6167 | ieee80211_crypto_wep_exit(); | 6166 | ieee80211_crypto_wep_exit(); |
6167 | ieee80211_crypto_deinit(); | ||
6168 | DMESG("Exiting"); | 6168 | DMESG("Exiting"); |
6169 | } | 6169 | } |
6170 | 6170 | ||