]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sparse: ->ifr_data fixes
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Thu, 3 Jun 2004 17:38:18 +0000 (10:38 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 3 Jun 2004 17:38:18 +0000 (10:38 -0700)
b44.c: ->ioctl() is broken, since it uses &ifr->ifr_data instead of
ifr->ifr_data itself.  Surprise, surprise, copy_from_user() on that address
doesn't do any good...

baycom_epp.c: does get_user() of the first word of structure, then
immediately does copy_from_user() on the entire thing and completely ignores
the value read by get_user() (it uses the same value in copied structure
instead).  Bogus get_user() call removed.

drivers/net/b44.c
drivers/net/hamradio/baycom_epp.c

index d7f2142f8d6a2d6d00c8acf12d9e5e95691a3601..531568949024afab3f13f6ac2925483b3569ef81 100644 (file)
@@ -1633,7 +1633,7 @@ static struct ethtool_ops b44_ethtool_ops = {
 
 static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-       struct mii_ioctl_data __user *data = (struct mii_ioctl_data __user *)&ifr->ifr_data;
+       struct mii_ioctl_data __user *data = ifr->ifr_data;
        struct b44 *bp = netdev_priv(dev);
        int err;
 
index d5b7fd96f36c0dfb7b2e85a2f0eab2b7b8b430f2..d5b7db1bd2cae3b9a088336f3a794bd40dfc7d11 100644 (file)
@@ -1166,8 +1166,6 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        bc = netdev_priv(dev);
        if (cmd != SIOCDEVPRIVATE)
                return -ENOIOCTLCMD;
-       if (get_user(cmd, (int *)ifr->ifr_data))
-               return -EFAULT;
 
        if (copy_from_user(&hi, ifr->ifr_data, sizeof(hi)))
                return -EFAULT;