Skip to contentSkip to conversation

udp: fix if statement in SIOCINQ ioctl

PATCH Applied Dan Carpenter 4 participants 4 messages Apr 18, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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')
net/ipv4/udp.c +0 -6
index f186313..37e09c3 100644
@@ -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);
 	}
 
maintainer Acked-by
#2 lore raw
Quoted 8 lines · Eric Dumazet
Quoted 5 lines · Dan Carpenter

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')

Thanks for catching this.