svcrdma: fix an incorrect check on -E2BIG and -EINVAL
authorColin Ian King <colin.king@canonical.com>
Thu, 13 Jul 2017 17:51:15 +0000 (18:51 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 13 Jul 2017 18:18:47 +0000 (14:18 -0400)
The current check will always be true and will always jump to
err1, this looks dubious to me. I believe && should be used
instead of ||.

Detected by CoverityScan, CID#1450120 ("Logically Dead Code")

Fixes: 107c1d0a991a ("svcrdma: Avoid Send Queue overflow")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/xprtrdma/svc_rdma_sendto.c

index 19fd01e4b690075a90e6e2425f1eb99c5ac9295c..7c3a211e0e9a9e17ed388696ebff789512289cf4 100644 (file)
@@ -684,7 +684,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
        return 0;
 
  err2:
-       if (ret != -E2BIG || ret != -EINVAL)
+       if (ret != -E2BIG && ret != -EINVAL)
                goto err1;
 
        ret = svc_rdma_post_recv(rdma, GFP_KERNEL);