Skip to content

Commit

Permalink
[8021Q]: vlan_ioctl_handler: fix return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and David S. Miller committed Jul 24, 2007
1 parent 79d310d commit 3f5f434
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand All @@ -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,
Expand Down

0 comments on commit 3f5f434

Please sign in to comment.