diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2013-09-23 20:30:42 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-05 07:13:10 -0700 |
commit | 54cff964637d840e7860afa49a369c84c8cfbf61 (patch) | |
tree | ad0615d3d9e267e236d4bd9fb0e1b4b44255920a | |
parent | d66aed99301eb9dd6a6e71f73081057480369ab4 (diff) |
staging: vt6656: [BUG] iwctl_siwencodeext return if device not open
commit 5e8c3d3e41b0bf241e830a1ee0752405adecc050 upstream.
Don't allow entry to iwctl_siwencodeext if device not open.
This fixes a race condition where wpa supplicant/network manager
enters the function when the device is already closed.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/vt6656/iwctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c index d0cf7d8a20e..8872e0f84f4 100644 --- a/drivers/staging/vt6656/iwctl.c +++ b/drivers/staging/vt6656/iwctl.c @@ -1634,6 +1634,9 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, if (pMgmt == NULL) return -EFAULT; + if (!(pDevice->flags & DEVICE_FLAGS_OPENED)) + return -ENODEV; + buf = kzalloc(sizeof(struct viawget_wpa_param), GFP_KERNEL); if (buf == NULL) return -ENOMEM; |