Skip to content

Commit

Permalink
svcrdma: fix an incorrect check on -E2BIG and -EINVAL
Browse files Browse the repository at this point in the history
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: 107c1d0 ("svcrdma: Avoid Send Queue overflow")
Signed-off-by: Colin Ian King <[email protected]>
Reviewed-by: Chuck Lever <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
Colin Ian King authored and J. Bruce Fields committed Jul 13, 2017
1 parent 630458e commit b20dae7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/xprtrdma/svc_rdma_sendto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b20dae7

Please sign in to comment.