Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86c1dcfc authored by Florian Zumbiehl's avatar Florian Zumbiehl Committed by David S. Miller
Browse files

[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: default avatarFlorian Zumbiehl <florz@florz.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c61a7d10
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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;
}
+4 −7
Original line number Diff line number Diff line
@@ -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;