Skip to content

Commit 4f3ed83

Browse files
Dan CarpenterTrond Myklebust
authored andcommitted
SUNRPC: Add an IS_ERR() check back to where it was
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 25cf32a ("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 13bd901 ("Revert "SUNRPC: Remove unreachable error condition""). Fixes: 037e910 ("SUNRPC: Remove unreachable error condition in rpcb_getport_async()") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 6bd1a77 commit 4f3ed83

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/sunrpc/rpcb_clnt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,10 @@ void rpcb_getport_async(struct rpc_task *task)
769769

770770
child = rpcb_call_async(rpcb_clnt, map, proc);
771771
rpc_release_client(rpcb_clnt);
772+
if (IS_ERR(child)) {
773+
/* rpcb_map_release() has freed the arguments */
774+
return;
775+
}
772776

773777
xprt->stat.bind_count++;
774778
rpc_put_task(child);

0 commit comments

Comments
 (0)