Skip to content

Commit

Permalink
[VLAN]: Add two missing checks to vlan_ioctl_handler()
Browse files Browse the repository at this point in the history
In vlan_ioctl_handler() the code misses couple checks for
error return values.

Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mika Kukkonen authored and David S. Miller committed Dec 22, 2005
1 parent 0d77d59 commit 7eb1b3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ static int vlan_ioctl_handler(void __user *arg)
break;
case GET_VLAN_REALDEV_NAME_CMD:
err = vlan_dev_get_realdev_name(args.device1, args.u.device2);
if (err)
goto out;
if (copy_to_user(arg, &args,
sizeof(struct vlan_ioctl_args))) {
err = -EFAULT;
Expand All @@ -761,6 +763,8 @@ static int vlan_ioctl_handler(void __user *arg)

case GET_VLAN_VID_CMD:
err = vlan_dev_get_vid(args.device1, &vid);
if (err)
goto out;
args.u.VID = vid;
if (copy_to_user(arg, &args,
sizeof(struct vlan_ioctl_args))) {
Expand All @@ -774,7 +778,7 @@ static int vlan_ioctl_handler(void __user *arg)
__FUNCTION__, args.cmd);
return -EINVAL;
};

out:
return err;
}

Expand Down

0 comments on commit 7eb1b3d

Please sign in to comment.