net: Fix inverted test in __skb_recv_datagram
authorRainer Weikusat <rweikusat@mobileactivedefense.com>
Tue, 8 Dec 2015 14:47:56 +0000 (14:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Dec 2015 16:30:17 +0000 (11:30 -0500)
As the kernel generally uses negated error numbers, *err needs to be
compared with -EAGAIN (d'oh).

Signed-off-by: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Fixes: ea3793ee29d3 ("core: enable more fine-grained datagram reception control")
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/datagram.c

index 7daff66d3d0bedf249b61e6bb393caed0263c789..fa9dc6450b08137078d5ecae2ebe01801083a17c 100644 (file)
@@ -275,7 +275,7 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags,
                if (skb)
                        return skb;
 
-               if (*err != EAGAIN)
+               if (*err != -EAGAIN)
                        break;
        } while (timeo &&
                !__skb_wait_for_more_packets(sk, err, &timeo, last));