udp: fix if statement in SIOCINQ ioctl
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 18 Apr 2016 08:44:49 +0000 (11:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Apr 2016 17:40:08 +0000 (13:40 -0400)
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 <dan.carpenter@oracle.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c

index f1863136d3e40abc4dce815932be7a81d81eeec4..37e09c3dd0468f46a0ae153038a9d11745311c6c 100644 (file)
@@ -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);
        }