From: Dan Carpenter Date: Mon, 18 Apr 2016 08:44:49 +0000 (+0300) Subject: udp: fix if statement in SIOCINQ ioctl X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=110361f41c17d1f565e2fd03a0af044c29e6513a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git udp: fix if statement in SIOCINQ ioctl We deleted a line of code and accidentally made the "return put_user()" part of the if statement when it's supposed to be unconditional. Fixes: 9f9a45beaa96 ('udp: do not expect udp headers on ioctl SIOCINQ') Signed-off-by: Dan Carpenter Acked-by: Eric Dumazet Acked-by: Willem de Bruijn Signed-off-by: David S. Miller --- diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index f1863136d3e4..37e09c3dd046 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1276,12 +1276,6 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg) { unsigned int amount = first_packet_length(sk); - if (amount) - /* - * We will only return the amount - * of this packet since that is all - * that will be read. - */ return put_user(amount, (int __user *)arg); }