* [PATCH] VLAN: Add two missing checks to vlan_ioctl_handler()
@ 2005-12-21 20:50 Mika Kukkonen
2005-12-22 2:39 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Mika Kukkonen @ 2005-12-21 20:50 UTC (permalink / raw)
To: vlan, netdev; +Cc: linux-kernel
In vlan_ioctl_handler() the code misses couple checks for
error return values.
Signed-of-by: Mika Kukkonen <mikukkon@iki.fi>
---
net/8021q/vlan.c | 6 +++++-
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 __use
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 __use
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 __use
__FUNCTION__, args.cmd);
return -EINVAL;
};
-
+out:
return err;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] VLAN: Add two missing checks to vlan_ioctl_handler()
2005-12-21 20:50 [PATCH] VLAN: Add two missing checks to vlan_ioctl_handler() Mika Kukkonen
@ 2005-12-22 2:39 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2005-12-22 2:39 UTC (permalink / raw)
To: mikukkon; +Cc: vlan, netdev, linux-kernel
From: Mika Kukkonen <mikukkon@iki.fi>
Date: Wed, 21 Dec 2005 22:50:15 +0200
> In vlan_ioctl_handler() the code misses couple checks for
> error return values.
>
> Signed-of-by: Mika Kukkonen <mikukkon@iki.fi>
Looks good, applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-12-22 2:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-21 20:50 [PATCH] VLAN: Add two missing checks to vlan_ioctl_handler() Mika Kukkonen
2005-12-22 2:39 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).