Search Linux Wireless

[PATCH] fix wext_ioctl() exit path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes the wext_ioctl() exit path, it was copying things from "&ifr"
instead of "ifr", caused by now using a pointer to ifr in that new
function.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

---
This should fix it. Looks like I had it right for the cfg80211 exit path
but not the old one...

--- wireless-dev.orig/net/wireless/wext-common.c	2007-02-17 01:46:03.204695664 +0100
+++ wireless-dev/net/wireless/wext-common.c	2007-02-17 01:59:18.075094300 +0100
@@ -640,26 +640,24 @@ int wext_ioctl(unsigned int cmd, struct 
 
 	rtnl_unlock();
 
-	if (IW_IS_GET(cmd) && copy_to_user(arg, &ifr, sizeof(struct ifreq)))
-		ret = -EFAULT;
-
 	/* haha, I cheat here by allowing a driver or stack to have both WE and
 	 * CFG80211-WE for a little while during conversion... wext returns
 	 * -EOPNOTSUPP if a handler is not assigned, so we can in that case try
 	 * calling cfg80211's compat code instead.
 	 */
 	if (ret != -EOPNOTSUPP)
-		return ret;
+		goto out;
 #endif
 
 #ifdef CONFIG_CFG80211_WEXT_COMPAT
 	/* no need to hold rtnl lock here for the new stuff,
 	 * we properly use dev_get_by_name() and dev_put() */
 	ret = call_cfg80211_wext_ioctl(ifr, cmd);
+#endif
 
+ out:
 	if (IW_IS_GET(cmd) && copy_to_user(arg, ifr, sizeof(struct ifreq)))
 		ret = -EFAULT;
-#endif
 
 	return ret;
 }


-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux