Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] staging: vt6656: [BUG] iwctl_siwencodeext return if device not open
@ 2013-09-23 19:30 Malcolm Priestley
  0 siblings, 0 replies; only message in thread
From: Malcolm Priestley @ 2013-09-23 19:30 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

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>
Cc: stable@vger.kernel.org # 3.8+
---
 drivers/staging/vt6656/iwctl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index 033cb50..5968888 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;
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-23 19:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 19:30 [PATCH] staging: vt6656: [BUG] iwctl_siwencodeext return if device not open Malcolm Priestley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox