Commit 0bd35534 authored by Sean MacLennan's avatar Sean MacLennan Committed by Greg Kroah-Hartman

staging:rtl8192e: Usage count off by one

The rtllib driver is not calling try_module_get() when loading the
encryption modules. Because of this, you can never remove the module
once you have used it one (i.e. bring up the wireless interface).
Signed-off-by: default avatarSean MacLennan <seanm@seanm.ca>
Tested-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f52e2408
...@@ -3328,7 +3328,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, ...@@ -3328,7 +3328,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
goto done; goto done;
} }
new_crypt->ops = ops; new_crypt->ops = ops;
if (new_crypt->ops) if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
new_crypt->priv = new_crypt->priv =
new_crypt->ops->init(param->u.crypt.idx); new_crypt->ops->init(param->u.crypt.idx);
......
...@@ -623,7 +623,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, ...@@ -623,7 +623,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
goto done; goto done;
} }
new_crypt->ops = ops; new_crypt->ops = ops;
if (new_crypt->ops) if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
new_crypt->priv = new_crypt->ops->init(idx); new_crypt->priv = new_crypt->ops->init(idx);
if (new_crypt->priv == NULL) { if (new_crypt->priv == NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment