]> err.no Git - linux-2.6/commitdiff
[8021Q]: vlan_ioctl_handler: fix return value
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 24 Jul 2007 22:37:11 +0000 (15:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jul 2007 22:37:11 +0000 (15:37 -0700)
net/8021q/vlan.c: In function 'vlan_ioctl_handler':
net/8021q/vlan.c:700: warning: 'err' may be used uninitialized in this function

The warning is incorrect, but from my reading this ioctl will return -EINVAL
on success.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/8021q/vlan.c

index cda936b77d222b2bb68cc4b79f8ba1e468cd9de3..1583c5ef963f06013a455634b5b8604916c1289c 100644 (file)
@@ -810,6 +810,7 @@ static int vlan_ioctl_handler(void __user *arg)
                err = -EINVAL;
                break;
        case GET_VLAN_REALDEV_NAME_CMD:
+               err = 0;
                vlan_dev_get_realdev_name(dev, args.u.device2);
                if (copy_to_user(arg, &args,
                                 sizeof(struct vlan_ioctl_args))) {
@@ -818,6 +819,7 @@ static int vlan_ioctl_handler(void __user *arg)
                break;
 
        case GET_VLAN_VID_CMD:
+               err = 0;
                vlan_dev_get_vid(dev, &vid);
                args.u.VID = vid;
                if (copy_to_user(arg, &args,