diff options
author | Sean MacLennan <seanm@seanm.ca> | 2015-11-15 19:51:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-07 20:01:45 -0800 |
commit | 0bd35534933feceb7afb383ce7947f2841132c99 (patch) | |
tree | 10c6441bb35a9a8af525151c3bb97629a06f1b1c /drivers/staging/rtl8192e | |
parent | f52e240816cb268a11fee011aa9b7dc4185d9ded (diff) |
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>
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_wx.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index d0fedb0ff132..acccf9b44b98 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -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); diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 80f7a099dff1..84e6272f28cd 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -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) { |