From 86c1dcfc96a778433ebc6e9b1d3e80a126cb80f2 Mon Sep 17 00:00:00 2001 From: Florian Zumbiehl Date: Mon, 30 Jul 2007 17:48:23 -0700 Subject: [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 Signed-off-by: David S. Miller --- drivers/net/pppox.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers/net/pppox.c') 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) { 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; -- cgit v1.2.3-59-g8ed1b