summaryrefslogtreecommitdiffstats
path: root/net/8021q
diff options
context:
space:
mode:
authorMika Kukkonen <mikukkon@iki.fi>2005-12-21 18:39:49 -0800
committerDavid S. Miller <davem@davemloft.net>2005-12-21 18:39:49 -0800
commit7eb1b3d372a53fe9220b9e3b579886db0fe2f897 (patch)
tree76d3b65fc078ac873428796bfd7d2785dd2a4aa4 /net/8021q
parent0d77d59f6293438f25e0560172699c0d3e4ef5ac (diff)
downloadop-kernel-dev-7eb1b3d372a53fe9220b9e3b579886db0fe2f897.zip
op-kernel-dev-7eb1b3d372a53fe9220b9e3b579886db0fe2f897.tar.gz
[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: Mika Kukkonen <mikukkon@iki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r--net/8021q/vlan.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 91e412b..67465b6 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -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;
@@ -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))) {
@@ -774,7 +778,7 @@ static int vlan_ioctl_handler(void __user *arg)
__FUNCTION__, args.cmd);
return -EINVAL;
};
-
+out:
return err;
}
OpenPOWER on IntegriCloud