forked from Minki/linux
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: Sean MacLennan <seanm@seanm.ca> Tested-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f52e240816
commit
0bd3553493
@ -3328,7 +3328,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
|
||||
goto done;
|
||||
}
|
||||
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(param->u.crypt.idx);
|
||||
|
||||
|
@ -623,7 +623,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
|
||||
goto done;
|
||||
}
|
||||
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);
|
||||
|
||||
if (new_crypt->priv == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user