Commit 7eb1b3d3 authored by Mika Kukkonen's avatar Mika Kukkonen Committed by David S. Miller

[VLAN]: Add two missing checks to vlan_ioctl_handler()

In vlan_ioctl_handler() the code misses couple checks for
error return values.
Signed-off-by: default avatarMika Kukkonen <mikukkon@iki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0d77d59f
...@@ -753,6 +753,8 @@ static int vlan_ioctl_handler(void __user *arg) ...@@ -753,6 +753,8 @@ static int vlan_ioctl_handler(void __user *arg)
break; break;
case GET_VLAN_REALDEV_NAME_CMD: case GET_VLAN_REALDEV_NAME_CMD:
err = vlan_dev_get_realdev_name(args.device1, args.u.device2); err = vlan_dev_get_realdev_name(args.device1, args.u.device2);
if (err)
goto out;
if (copy_to_user(arg, &args, if (copy_to_user(arg, &args,
sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) {
err = -EFAULT; err = -EFAULT;
...@@ -761,6 +763,8 @@ static int vlan_ioctl_handler(void __user *arg) ...@@ -761,6 +763,8 @@ static int vlan_ioctl_handler(void __user *arg)
case GET_VLAN_VID_CMD: case GET_VLAN_VID_CMD:
err = vlan_dev_get_vid(args.device1, &vid); err = vlan_dev_get_vid(args.device1, &vid);
if (err)
goto out;
args.u.VID = vid; args.u.VID = vid;
if (copy_to_user(arg, &args, if (copy_to_user(arg, &args,
sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) {
...@@ -774,7 +778,7 @@ static int vlan_ioctl_handler(void __user *arg) ...@@ -774,7 +778,7 @@ static int vlan_ioctl_handler(void __user *arg)
__FUNCTION__, args.cmd); __FUNCTION__, args.cmd);
return -EINVAL; return -EINVAL;
}; };
out:
return err; return err;
} }
......
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