From 8facd5fb73c6e960555e5913743dfbb6c3d984a5 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Tue, 2 Apr 2013 13:55:40 -0700 Subject: net: fix smatch warnings inside datagram_poll Commit 7d4c04fc170087119727119074e72445f2bb192b ("net: add option to enable error queue packets waking select") has an issue due to operator precedence causing the bit-wise OR to bind to the sock_flags call instead of the result of the terniary conditional. This fixes the *_poll functions to work properly. The old code results in "mask |= POLLPRI" instead of what was intended, which is to only include POLLPRI when the socket option is enabled. Signed-off-by: Jacob Keller Signed-off-by: David S. Miller --- net/nfc/llcp/sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/nfc') diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c index 2d55e8a4595..6b3254452b3 100644 --- a/net/nfc/llcp/sock.c +++ b/net/nfc/llcp/sock.c @@ -522,7 +522,7 @@ static unsigned int llcp_sock_poll(struct file *file, struct socket *sock, if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) mask |= POLLERR | - sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0; + (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); if (!skb_queue_empty(&sk->sk_receive_queue)) mask |= POLLIN | POLLRDNORM; -- cgit v1.2.3