Commit 53f97fb4 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: ->ifr_data fixes

	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.
parent ee5cedda
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment