diff options
author | Adrian Bunk <bunk@stusta.de> | 2007-04-05 04:08:21 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-05 06:12:47 +0200 |
commit | 418106d6248618bca1add65168a82974c72206db (patch) | |
tree | fe8b9484c06814c8d11f4e114db460ebbe613f3c /net | |
parent | [PATCH] md: avoid a deadlock when removing a device from an md array via sysfs (diff) | |
download | linux-418106d6248618bca1add65168a82974c72206db.tar.xz linux-418106d6248618bca1add65168a82974c72206db.zip |
[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>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svcsock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index f6e1eb1ea720..593f62ff8521 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -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); |