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

svcrdma: fix an incorrect check on -E2BIG and -EINVAL

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>

authored by

Colin Ian King and committed by
J. Bruce Fields
b20dae70 630458e7

+1 -1
+1 -1
net/sunrpc/xprtrdma/svc_rdma_sendto.c
··· 684 684 return 0; 685 685 686 686 err2: 687 - if (ret != -E2BIG || ret != -EINVAL) 687 + if (ret != -E2BIG && ret != -EINVAL) 688 688 goto err1; 689 689 690 690 ret = svc_rdma_post_recv(rdma, GFP_KERNEL);