diff options
author | Florian Zumbiehl <florz@florz.de> | 2007-07-30 20:48:23 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-31 05:28:22 -0400 |
commit | 86c1dcfc96a778433ebc6e9b1d3e80a126cb80f2 (patch) | |
tree | ad6f69355b76974d2a80ab56313225aa557eb459 /drivers | |
parent | c61a7d10efbd187ab9bb54871238ebd1dfcacd44 (diff) |
[PPPoX/E]: return ENOTTY on unknown ioctl requests
here another patch for the PPPoX/E code that makes sure that ENOTTY is
returned for unknown ioctl requests rather than 0 (and removes another
unneeded initializer which I didn't bother creating a separate patch for).
Signed-off-by: Florian Zumbiehl <florz@florz.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/pppoe.c | 9 | ||||
-rw-r--r-- | drivers/net/pppox.c | 11 |
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 6f98834e6ace..f75aeaaf861f 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -664,8 +664,8 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd, | |||
664 | { | 664 | { |
665 | struct sock *sk = sock->sk; | 665 | struct sock *sk = sock->sk; |
666 | struct pppox_sock *po = pppox_sk(sk); | 666 | struct pppox_sock *po = pppox_sk(sk); |
667 | int val = 0; | 667 | int val; |
668 | int err = 0; | 668 | int err; |
669 | 669 | ||
670 | switch (cmd) { | 670 | switch (cmd) { |
671 | case PPPIOCGMRU: | 671 | case PPPIOCGMRU: |
@@ -754,8 +754,9 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd, | |||
754 | err = 0; | 754 | err = 0; |
755 | break; | 755 | break; |
756 | 756 | ||
757 | default:; | 757 | default: |
758 | }; | 758 | err = -ENOTTY; |
759 | } | ||
759 | 760 | ||
760 | return err; | 761 | return err; |
761 | } | 762 | } |
diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c index f3e47d0c2b3c..25c52b55c38f 100644 --- a/drivers/net/pppox.c +++ b/drivers/net/pppox.c | |||
@@ -73,7 +73,7 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
73 | { | 73 | { |
74 | struct sock *sk = sock->sk; | 74 | struct sock *sk = sock->sk; |
75 | struct pppox_sock *po = pppox_sk(sk); | 75 | struct pppox_sock *po = pppox_sk(sk); |
76 | int rc = 0; | 76 | int rc; |
77 | 77 | ||
78 | lock_sock(sk); | 78 | lock_sock(sk); |
79 | 79 | ||
@@ -94,12 +94,9 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
94 | break; | 94 | break; |
95 | } | 95 | } |
96 | default: | 96 | default: |
97 | if (pppox_protos[sk->sk_protocol]->ioctl) | 97 | rc = pppox_protos[sk->sk_protocol]->ioctl ? |
98 | rc = pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, | 98 | pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, arg) : -ENOTTY; |
99 | arg); | 99 | } |
100 | |||
101 | break; | ||
102 | }; | ||
103 | 100 | ||
104 | release_sock(sk); | 101 | release_sock(sk); |
105 | return rc; | 102 | return rc; |