Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] net/sunrpc/svcsock.c: fix a check

The return value of kernel_recvmsg() should be assigned to "err", not
compared with the random value of a never initialized "err" (and the "< 0"
check wrongly always returned false since == comparisons never have a
result < 0).

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Adrian Bunk and committed by
Linus Torvalds
418106d6 5792a285

+2 -2
+2 -2
net/sunrpc/svcsock.c
··· 779 779 } 780 780 781 781 clear_bit(SK_DATA, &svsk->sk_flags); 782 - while ((err == kernel_recvmsg(svsk->sk_sock, &msg, NULL, 783 - 0, 0, MSG_PEEK | MSG_DONTWAIT)) < 0 || 782 + while ((err = kernel_recvmsg(svsk->sk_sock, &msg, NULL, 783 + 0, 0, MSG_PEEK | MSG_DONTWAIT)) < 0 || 784 784 (skb = skb_recv_datagram(svsk->sk_sk, 0, 1, &err)) == NULL) { 785 785 if (err == -EAGAIN) { 786 786 svc_sock_received(svsk);