Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=86c1dcfc96a778433ebc6e9b1d3e80a126cb80f2
Commit:     86c1dcfc96a778433ebc6e9b1d3e80a126cb80f2
Parent:     c61a7d10efbd187ab9bb54871238ebd1dfcacd44
Author:     Florian Zumbiehl <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 30 17:48:23 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Jul 31 02:28:22 2007 -0700

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/pppoe.c |    9 +++++----
 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 6f98834..f75aeaa 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,
 {
        struct sock *sk = sock->sk;
        struct pppox_sock *po = pppox_sk(sk);
-       int val = 0;
-       int err = 0;
+       int val;
+       int err;
 
        switch (cmd) {
        case PPPIOCGMRU:
@@ -754,8 +754,9 @@ static int pppoe_ioctl(struct socket *sock, unsigned int 
cmd,
                err = 0;
                break;
 
-       default:;
-       };
+       default:
+               err = -ENOTTY;
+       }
 
        return err;
 }
diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c
index f3e47d0..25c52b5 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)
 {
        struct sock *sk = sock->sk;
        struct pppox_sock *po = pppox_sk(sk);
-       int rc = 0;
+       int rc;
 
        lock_sock(sk);
 
@@ -94,12 +94,9 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, 
unsigned long arg)
                break;
        }
        default:
-               if (pppox_protos[sk->sk_protocol]->ioctl)
-                       rc = pppox_protos[sk->sk_protocol]->ioctl(sock, cmd,
-                                                                 arg);
-
-               break;
-       };
+               rc = pppox_protos[sk->sk_protocol]->ioctl ?
+                       pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, arg) : 
-ENOTTY;
+       }
 
        release_sock(sk);
        return rc;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to