Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 418106d6 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds
Browse files

[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: default avatarAdrian Bunk <bunk@stusta.de>
Acked-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5792a285
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -779,7 +779,7 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
	}

	clear_bit(SK_DATA, &svsk->sk_flags);
	while ((err == kernel_recvmsg(svsk->sk_sock, &msg, NULL,
	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) {