Skip to content

Commit

Permalink
[PATCH] net/sunrpc/svcsock.c: fix a check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
AdrianBunk authored and Linus Torvalds committed Apr 5, 2007
1 parent 5792a28 commit 418106d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sunrpc/svcsock.c
Expand Up @@ -779,8 +779,8 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
}

clear_bit(SK_DATA, &svsk->sk_flags);
while ((err == kernel_recvmsg(svsk->sk_sock, &msg, NULL,
0, 0, MSG_PEEK | MSG_DONTWAIT)) < 0 ||
while ((err = kernel_recvmsg(svsk->sk_sock, &msg, NULL,
0, 0, MSG_PEEK | MSG_DONTWAIT)) < 0 ||
(skb = skb_recv_datagram(svsk->sk_sk, 0, 1, &err)) == NULL) {
if (err == -EAGAIN) {
svc_sock_received(svsk);
Expand Down

0 comments on commit 418106d

Please sign in to comment.