]> git.itanic.dy.fi Git - linux-stable/commitdiff
SUNRPC: Add an IS_ERR() check back to where it was
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 11 Oct 2023 08:00:22 +0000 (11:00 +0300)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 1 Nov 2023 19:40:44 +0000 (15:40 -0400)
This IS_ERR() check was deleted during in a cleanup because, at the time,
the rpcb_call_async() function could not return an error pointer.  That
changed in commit 25cf32ad5dba ("SUNRPC: Handle allocation failure in
rpc_new_task()") and now it can return an error pointer.  Put the check
back.

A related revert was done in commit 13bd90141804 ("Revert "SUNRPC:
Remove unreachable error condition"").

Fixes: 037e910b52b0 ("SUNRPC: Remove unreachable error condition in rpcb_getport_async()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/rpcb_clnt.c

index 5988a5c5ff3f0c430d622336f2eadd3af95de14a..102c3818bc54d4f9a1fc5f854c3a841289974869 100644 (file)
@@ -769,6 +769,10 @@ void rpcb_getport_async(struct rpc_task *task)
 
        child = rpcb_call_async(rpcb_clnt, map, proc);
        rpc_release_client(rpcb_clnt);
+       if (IS_ERR(child)) {
+               /* rpcb_map_release() has freed the arguments */
+               return;
+       }
 
        xprt->stat.bind_count++;
        rpc_put_task(child);