diff options
author | Herton Ronaldo Krzesinski <herton@mandriva.com.br> | 2009-10-02 10:03:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-10-30 17:47:43 -0400 |
commit | a010a3375227efbd6b8ac11b99c34c807a77c45a (patch) | |
tree | 40feb112ab03ab6786645b6d9d3fe21206f78c8a /drivers | |
parent | 557c0288b59a7b81513de4242b893654c70d636c (diff) |
Staging: rtl8187se/rtl8192e/rtl8192su: allow module unload
On rtl81* additions, they had its wireless stack made builtin instead of
separated modules. But try_module_get/module_put in stack were kept,
they are uneeded with the stack builtin and makes rtl81* modules
impossible to remove on a system with an rtl81* card. request_module
calls are also uneeded with stack builtin, so remove them too.
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
12 files changed, 37 insertions, 96 deletions
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c index 013c3e19ae25..4c5d63fd5833 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c | |||
@@ -53,10 +53,8 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, | |||
53 | 53 | ||
54 | list_del(ptr); | 54 | list_del(ptr); |
55 | 55 | ||
56 | if (entry->ops) { | 56 | if (entry->ops) |
57 | entry->ops->deinit(entry->priv); | 57 | entry->ops->deinit(entry->priv); |
58 | module_put(entry->ops->owner); | ||
59 | } | ||
60 | kfree(entry); | 58 | kfree(entry); |
61 | } | 59 | } |
62 | } | 60 | } |
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c index 6fbe4890cb66..18392fce487d 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c | |||
@@ -189,10 +189,8 @@ void free_ieee80211(struct net_device *dev) | |||
189 | for (i = 0; i < WEP_KEYS; i++) { | 189 | for (i = 0; i < WEP_KEYS; i++) { |
190 | struct ieee80211_crypt_data *crypt = ieee->crypt[i]; | 190 | struct ieee80211_crypt_data *crypt = ieee->crypt[i]; |
191 | if (crypt) { | 191 | if (crypt) { |
192 | if (crypt->ops) { | 192 | if (crypt->ops) |
193 | crypt->ops->deinit(crypt->priv); | 193 | crypt->ops->deinit(crypt->priv); |
194 | module_put(crypt->ops->owner); | ||
195 | } | ||
196 | kfree(crypt); | 194 | kfree(crypt); |
197 | ieee->crypt[i] = NULL; | 195 | ieee->crypt[i] = NULL; |
198 | } | 196 | } |
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c index 59b2ab48cdcf..334e4c7ec61b 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c | |||
@@ -2839,16 +2839,12 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, | |||
2839 | goto skip_host_crypt; | 2839 | goto skip_host_crypt; |
2840 | 2840 | ||
2841 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 2841 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
2842 | if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { | 2842 | if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) |
2843 | request_module("ieee80211_crypt_wep"); | ||
2844 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 2843 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
2845 | } else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) { | 2844 | else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) |
2846 | request_module("ieee80211_crypt_tkip"); | ||
2847 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 2845 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
2848 | } else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) { | 2846 | else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) |
2849 | request_module("ieee80211_crypt_ccmp"); | ||
2850 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 2847 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
2851 | } | ||
2852 | if (ops == NULL) { | 2848 | if (ops == NULL) { |
2853 | printk("unknown crypto alg '%s'\n", param->u.crypt.alg); | 2849 | printk("unknown crypto alg '%s'\n", param->u.crypt.alg); |
2854 | param->u.crypt.err = IEEE_CRYPT_ERR_UNKNOWN_ALG; | 2850 | param->u.crypt.err = IEEE_CRYPT_ERR_UNKNOWN_ALG; |
@@ -2869,7 +2865,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, | |||
2869 | } | 2865 | } |
2870 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | 2866 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); |
2871 | new_crypt->ops = ops; | 2867 | new_crypt->ops = ops; |
2872 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | 2868 | if (new_crypt->ops) |
2873 | new_crypt->priv = | 2869 | new_crypt->priv = |
2874 | new_crypt->ops->init(param->u.crypt.idx); | 2870 | new_crypt->ops->init(param->u.crypt.idx); |
2875 | 2871 | ||
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c index 8d8bdd0a130e..a08b97a09512 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c | |||
@@ -331,12 +331,10 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, | |||
331 | return -ENOMEM; | 331 | return -ENOMEM; |
332 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | 332 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); |
333 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); | 333 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); |
334 | if (!new_crypt->ops) { | 334 | if (!new_crypt->ops) |
335 | request_module("ieee80211_crypt_wep"); | ||
336 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); | 335 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); |
337 | } | ||
338 | 336 | ||
339 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | 337 | if (new_crypt->ops) |
340 | new_crypt->priv = new_crypt->ops->init(key); | 338 | new_crypt->priv = new_crypt->ops->init(key); |
341 | 339 | ||
342 | if (!new_crypt->ops || !new_crypt->priv) { | 340 | if (!new_crypt->ops || !new_crypt->priv) { |
@@ -483,7 +481,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
483 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; | 481 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; |
484 | int i, idx, ret = 0; | 482 | int i, idx, ret = 0; |
485 | int group_key = 0; | 483 | int group_key = 0; |
486 | const char *alg, *module; | 484 | const char *alg; |
487 | struct ieee80211_crypto_ops *ops; | 485 | struct ieee80211_crypto_ops *ops; |
488 | struct ieee80211_crypt_data **crypt; | 486 | struct ieee80211_crypt_data **crypt; |
489 | 487 | ||
@@ -539,15 +537,12 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
539 | switch (ext->alg) { | 537 | switch (ext->alg) { |
540 | case IW_ENCODE_ALG_WEP: | 538 | case IW_ENCODE_ALG_WEP: |
541 | alg = "WEP"; | 539 | alg = "WEP"; |
542 | module = "ieee80211_crypt_wep"; | ||
543 | break; | 540 | break; |
544 | case IW_ENCODE_ALG_TKIP: | 541 | case IW_ENCODE_ALG_TKIP: |
545 | alg = "TKIP"; | 542 | alg = "TKIP"; |
546 | module = "ieee80211_crypt_tkip"; | ||
547 | break; | 543 | break; |
548 | case IW_ENCODE_ALG_CCMP: | 544 | case IW_ENCODE_ALG_CCMP: |
549 | alg = "CCMP"; | 545 | alg = "CCMP"; |
550 | module = "ieee80211_crypt_ccmp"; | ||
551 | break; | 546 | break; |
552 | default: | 547 | default: |
553 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", | 548 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", |
@@ -558,10 +553,8 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
558 | // printk("8-09-08-9=====>%s, alg name:%s\n",__func__, alg); | 553 | // printk("8-09-08-9=====>%s, alg name:%s\n",__func__, alg); |
559 | 554 | ||
560 | ops = ieee80211_get_crypto_ops(alg); | 555 | ops = ieee80211_get_crypto_ops(alg); |
561 | if (ops == NULL) { | 556 | if (ops == NULL) |
562 | request_module(module); | ||
563 | ops = ieee80211_get_crypto_ops(alg); | 557 | ops = ieee80211_get_crypto_ops(alg); |
564 | } | ||
565 | if (ops == NULL) { | 558 | if (ops == NULL) { |
566 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", | 559 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", |
567 | dev->name, ext->alg); | 560 | dev->name, ext->alg); |
@@ -581,7 +574,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
581 | goto done; | 574 | goto done; |
582 | } | 575 | } |
583 | new_crypt->ops = ops; | 576 | new_crypt->ops = ops; |
584 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | 577 | if (new_crypt->ops) |
585 | new_crypt->priv = new_crypt->ops->init(idx); | 578 | new_crypt->priv = new_crypt->ops->init(idx); |
586 | if (new_crypt->priv == NULL) { | 579 | if (new_crypt->priv == NULL) { |
587 | kfree(new_crypt); | 580 | kfree(new_crypt); |
diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c index 1a8ea8a40c3c..b1c54932da3e 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c | |||
@@ -53,14 +53,8 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, | |||
53 | 53 | ||
54 | list_del(ptr); | 54 | list_del(ptr); |
55 | 55 | ||
56 | if (entry->ops) { | 56 | if (entry->ops) |
57 | entry->ops->deinit(entry->priv); | 57 | entry->ops->deinit(entry->priv); |
58 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) | ||
59 | module_put(entry->ops->owner); | ||
60 | #else | ||
61 | __MOD_DEC_USE_COUNT(entry->ops->owner); | ||
62 | #endif | ||
63 | } | ||
64 | kfree(entry); | 58 | kfree(entry); |
65 | } | 59 | } |
66 | } | 60 | } |
diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c index 16256a31f993..12c2a18e1fa2 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c | |||
@@ -242,14 +242,8 @@ void free_ieee80211(struct net_device *dev) | |||
242 | for (i = 0; i < WEP_KEYS; i++) { | 242 | for (i = 0; i < WEP_KEYS; i++) { |
243 | struct ieee80211_crypt_data *crypt = ieee->crypt[i]; | 243 | struct ieee80211_crypt_data *crypt = ieee->crypt[i]; |
244 | if (crypt) { | 244 | if (crypt) { |
245 | if (crypt->ops) { | 245 | if (crypt->ops) |
246 | crypt->ops->deinit(crypt->priv); | 246 | crypt->ops->deinit(crypt->priv); |
247 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) | ||
248 | module_put(crypt->ops->owner); | ||
249 | #else | ||
250 | __MOD_DEC_USE_COUNT(crypt->ops->owner); | ||
251 | #endif | ||
252 | } | ||
253 | kfree(crypt); | 247 | kfree(crypt); |
254 | ieee->crypt[i] = NULL; | 248 | ieee->crypt[i] = NULL; |
255 | } | 249 | } |
diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c index 2fc04df872ca..eae7c4579a68 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c | |||
@@ -3284,17 +3284,14 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, | |||
3284 | goto skip_host_crypt; | 3284 | goto skip_host_crypt; |
3285 | 3285 | ||
3286 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 3286 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
3287 | if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { | 3287 | if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) |
3288 | request_module("ieee80211_crypt_wep"); | ||
3289 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 3288 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
3290 | //set WEP40 first, it will be modified according to WEP104 or WEP40 at other place | 3289 | /* set WEP40 first, it will be modified according to WEP104 or |
3291 | } else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) { | 3290 | * WEP40 at other place */ |
3292 | request_module("ieee80211_crypt_tkip"); | 3291 | else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) |
3293 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 3292 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
3294 | } else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) { | 3293 | else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) |
3295 | request_module("ieee80211_crypt_ccmp"); | ||
3296 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 3294 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
3297 | } | ||
3298 | if (ops == NULL) { | 3295 | if (ops == NULL) { |
3299 | printk("unknown crypto alg '%s'\n", param->u.crypt.alg); | 3296 | printk("unknown crypto alg '%s'\n", param->u.crypt.alg); |
3300 | param->u.crypt.err = IEEE_CRYPT_ERR_UNKNOWN_ALG; | 3297 | param->u.crypt.err = IEEE_CRYPT_ERR_UNKNOWN_ALG; |
@@ -3315,11 +3312,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, | |||
3315 | } | 3312 | } |
3316 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | 3313 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); |
3317 | new_crypt->ops = ops; | 3314 | new_crypt->ops = ops; |
3318 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) | 3315 | if (new_crypt->ops) |
3319 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | ||
3320 | #else | ||
3321 | if (new_crypt->ops && try_inc_mod_count(new_crypt->ops->owner)) | ||
3322 | #endif | ||
3323 | new_crypt->priv = | 3316 | new_crypt->priv = |
3324 | new_crypt->ops->init(param->u.crypt.idx); | 3317 | new_crypt->ops->init(param->u.crypt.idx); |
3325 | 3318 | ||
diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c index 223483126b0e..4e34a1f4c66b 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c | |||
@@ -482,15 +482,9 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, | |||
482 | return -ENOMEM; | 482 | return -ENOMEM; |
483 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | 483 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); |
484 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); | 484 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); |
485 | if (!new_crypt->ops) { | 485 | if (!new_crypt->ops) |
486 | request_module("ieee80211_crypt_wep"); | ||
487 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); | 486 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); |
488 | } | 487 | if (new_crypt->ops) |
489 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) | ||
490 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | ||
491 | #else | ||
492 | if (new_crypt->ops && try_inc_mod_count(new_crypt->ops->owner)) | ||
493 | #endif | ||
494 | new_crypt->priv = new_crypt->ops->init(key); | 488 | new_crypt->priv = new_crypt->ops->init(key); |
495 | 489 | ||
496 | if (!new_crypt->ops || !new_crypt->priv) { | 490 | if (!new_crypt->ops || !new_crypt->priv) { |
@@ -644,7 +638,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
644 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; | 638 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; |
645 | int i, idx; | 639 | int i, idx; |
646 | int group_key = 0; | 640 | int group_key = 0; |
647 | const char *alg, *module; | 641 | const char *alg; |
648 | struct ieee80211_crypto_ops *ops; | 642 | struct ieee80211_crypto_ops *ops; |
649 | struct ieee80211_crypt_data **crypt; | 643 | struct ieee80211_crypt_data **crypt; |
650 | 644 | ||
@@ -711,15 +705,12 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
711 | switch (ext->alg) { | 705 | switch (ext->alg) { |
712 | case IW_ENCODE_ALG_WEP: | 706 | case IW_ENCODE_ALG_WEP: |
713 | alg = "WEP"; | 707 | alg = "WEP"; |
714 | module = "ieee80211_crypt_wep"; | ||
715 | break; | 708 | break; |
716 | case IW_ENCODE_ALG_TKIP: | 709 | case IW_ENCODE_ALG_TKIP: |
717 | alg = "TKIP"; | 710 | alg = "TKIP"; |
718 | module = "ieee80211_crypt_tkip"; | ||
719 | break; | 711 | break; |
720 | case IW_ENCODE_ALG_CCMP: | 712 | case IW_ENCODE_ALG_CCMP: |
721 | alg = "CCMP"; | 713 | alg = "CCMP"; |
722 | module = "ieee80211_crypt_ccmp"; | ||
723 | break; | 714 | break; |
724 | default: | 715 | default: |
725 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", | 716 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", |
@@ -730,10 +721,8 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
730 | printk("alg name:%s\n",alg); | 721 | printk("alg name:%s\n",alg); |
731 | 722 | ||
732 | ops = ieee80211_get_crypto_ops(alg); | 723 | ops = ieee80211_get_crypto_ops(alg); |
733 | if (ops == NULL) { | 724 | if (ops == NULL) |
734 | request_module(module); | ||
735 | ops = ieee80211_get_crypto_ops(alg); | 725 | ops = ieee80211_get_crypto_ops(alg); |
736 | } | ||
737 | if (ops == NULL) { | 726 | if (ops == NULL) { |
738 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", | 727 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", |
739 | dev->name, ext->alg); | 728 | dev->name, ext->alg); |
@@ -758,7 +747,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
758 | goto done; | 747 | goto done; |
759 | } | 748 | } |
760 | new_crypt->ops = ops; | 749 | new_crypt->ops = ops; |
761 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | 750 | if (new_crypt->ops) |
762 | new_crypt->priv = new_crypt->ops->init(idx); | 751 | new_crypt->priv = new_crypt->ops->init(idx); |
763 | if (new_crypt->priv == NULL) { | 752 | if (new_crypt->priv == NULL) { |
764 | kfree(new_crypt); | 753 | kfree(new_crypt); |
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c index d76a54d59d2f..521e7b989934 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_crypt.c | |||
@@ -53,10 +53,8 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, | |||
53 | 53 | ||
54 | list_del(ptr); | 54 | list_del(ptr); |
55 | 55 | ||
56 | if (entry->ops) { | 56 | if (entry->ops) |
57 | entry->ops->deinit(entry->priv); | 57 | entry->ops->deinit(entry->priv); |
58 | module_put(entry->ops->owner); | ||
59 | } | ||
60 | kfree(entry); | 58 | kfree(entry); |
61 | } | 59 | } |
62 | } | 60 | } |
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c index 68dc8fa094cc..c3383bb8b760 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c | |||
@@ -216,10 +216,8 @@ void free_ieee80211(struct net_device *dev) | |||
216 | for (i = 0; i < WEP_KEYS; i++) { | 216 | for (i = 0; i < WEP_KEYS; i++) { |
217 | struct ieee80211_crypt_data *crypt = ieee->crypt[i]; | 217 | struct ieee80211_crypt_data *crypt = ieee->crypt[i]; |
218 | if (crypt) { | 218 | if (crypt) { |
219 | if (crypt->ops) { | 219 | if (crypt->ops) |
220 | crypt->ops->deinit(crypt->priv); | 220 | crypt->ops->deinit(crypt->priv); |
221 | module_put(crypt->ops->owner); | ||
222 | } | ||
223 | kfree(crypt); | 221 | kfree(crypt); |
224 | ieee->crypt[i] = NULL; | 222 | ieee->crypt[i] = NULL; |
225 | } | 223 | } |
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c index c64ae03f68a0..fd8e11252f1b 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c | |||
@@ -3026,17 +3026,14 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, | |||
3026 | goto skip_host_crypt; | 3026 | goto skip_host_crypt; |
3027 | 3027 | ||
3028 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 3028 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
3029 | if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { | 3029 | if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) |
3030 | request_module("ieee80211_crypt_wep"); | ||
3031 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 3030 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
3032 | //set WEP40 first, it will be modified according to WEP104 or WEP40 at other place | 3031 | /* set WEP40 first, it will be modified according to WEP104 or |
3033 | } else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) { | 3032 | * WEP40 at other place */ |
3034 | request_module("ieee80211_crypt_tkip"); | 3033 | else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) |
3035 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 3034 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
3036 | } else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) { | 3035 | else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) |
3037 | request_module("ieee80211_crypt_ccmp"); | ||
3038 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); | 3036 | ops = ieee80211_get_crypto_ops(param->u.crypt.alg); |
3039 | } | ||
3040 | if (ops == NULL) { | 3037 | if (ops == NULL) { |
3041 | printk("unknown crypto alg '%s'\n", param->u.crypt.alg); | 3038 | printk("unknown crypto alg '%s'\n", param->u.crypt.alg); |
3042 | param->u.crypt.err = IEEE_CRYPT_ERR_UNKNOWN_ALG; | 3039 | param->u.crypt.err = IEEE_CRYPT_ERR_UNKNOWN_ALG; |
@@ -3058,7 +3055,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, | |||
3058 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | 3055 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); |
3059 | new_crypt->ops = ops; | 3056 | new_crypt->ops = ops; |
3060 | 3057 | ||
3061 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | 3058 | if (new_crypt->ops) |
3062 | new_crypt->priv = | 3059 | new_crypt->priv = |
3063 | new_crypt->ops->init(param->u.crypt.idx); | 3060 | new_crypt->ops->init(param->u.crypt.idx); |
3064 | 3061 | ||
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c index 107759024335..6146c6435dde 100644 --- a/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c | |||
@@ -358,11 +358,9 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, | |||
358 | return -ENOMEM; | 358 | return -ENOMEM; |
359 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | 359 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); |
360 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); | 360 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); |
361 | if (!new_crypt->ops) { | 361 | if (!new_crypt->ops) |
362 | request_module("ieee80211_crypt_wep"); | ||
363 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); | 362 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); |
364 | } | 363 | if (new_crypt->ops) |
365 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | ||
366 | new_crypt->priv = new_crypt->ops->init(key); | 364 | new_crypt->priv = new_crypt->ops->init(key); |
367 | 365 | ||
368 | if (!new_crypt->ops || !new_crypt->priv) { | 366 | if (!new_crypt->ops || !new_crypt->priv) { |
@@ -507,7 +505,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
507 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; | 505 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; |
508 | int i, idx; | 506 | int i, idx; |
509 | int group_key = 0; | 507 | int group_key = 0; |
510 | const char *alg, *module; | 508 | const char *alg; |
511 | struct ieee80211_crypto_ops *ops; | 509 | struct ieee80211_crypto_ops *ops; |
512 | struct ieee80211_crypt_data **crypt; | 510 | struct ieee80211_crypt_data **crypt; |
513 | 511 | ||
@@ -570,15 +568,12 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
570 | switch (ext->alg) { | 568 | switch (ext->alg) { |
571 | case IW_ENCODE_ALG_WEP: | 569 | case IW_ENCODE_ALG_WEP: |
572 | alg = "WEP"; | 570 | alg = "WEP"; |
573 | module = "ieee80211_crypt_wep"; | ||
574 | break; | 571 | break; |
575 | case IW_ENCODE_ALG_TKIP: | 572 | case IW_ENCODE_ALG_TKIP: |
576 | alg = "TKIP"; | 573 | alg = "TKIP"; |
577 | module = "ieee80211_crypt_tkip"; | ||
578 | break; | 574 | break; |
579 | case IW_ENCODE_ALG_CCMP: | 575 | case IW_ENCODE_ALG_CCMP: |
580 | alg = "CCMP"; | 576 | alg = "CCMP"; |
581 | module = "ieee80211_crypt_ccmp"; | ||
582 | break; | 577 | break; |
583 | default: | 578 | default: |
584 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", | 579 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", |
@@ -589,10 +584,8 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
589 | printk("alg name:%s\n",alg); | 584 | printk("alg name:%s\n",alg); |
590 | 585 | ||
591 | ops = ieee80211_get_crypto_ops(alg); | 586 | ops = ieee80211_get_crypto_ops(alg); |
592 | if (ops == NULL) { | 587 | if (ops == NULL) |
593 | request_module("%s", module); | ||
594 | ops = ieee80211_get_crypto_ops(alg); | 588 | ops = ieee80211_get_crypto_ops(alg); |
595 | } | ||
596 | if (ops == NULL) { | 589 | if (ops == NULL) { |
597 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", | 590 | IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", |
598 | dev->name, ext->alg); | 591 | dev->name, ext->alg); |
@@ -612,7 +605,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
612 | goto done; | 605 | goto done; |
613 | } | 606 | } |
614 | new_crypt->ops = ops; | 607 | new_crypt->ops = ops; |
615 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | 608 | if (new_crypt->ops) |
616 | new_crypt->priv = new_crypt->ops->init(idx); | 609 | new_crypt->priv = new_crypt->ops->init(idx); |
617 | if (new_crypt->priv == NULL) { | 610 | if (new_crypt->priv == NULL) { |
618 | kfree(new_crypt); | 611 | kfree(new_crypt); |