Skip to contentSkip to conversation

staging: vt6656: [BUG] iwctl_siwencodeext return if device not open

PATCH New Malcolm Priestley 1 participant 1 message Sep 23, 2013 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vt6656: [BUG] iwctl_siwencodeext return if device not open

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.

---
 drivers/staging/vt6656/iwctl.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/staging/vt6656/iwctl.c +3 -0
index 033cb50..5968888 100644
@@ -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;
Signature · 1 line
1.8.3.2