Blob Blame History Raw
From: Dan Aloni <dan.aloni@vastdata.com>
Date: Thu, 8 Sep 2022 17:08:51 +0300
Subject: [PATCH] Revert "SUNRPC: Remove unreachable error condition"
Git-commit: 13bd9014180425f5a35eaf3735971d582c299292
Patch-mainline: v6.0
References: git-fixes

This reverts commit efe57fd58e1cb77f9186152ee12a8aa4ae3348e0.

The assumption that it is impossible to return an ERR pointer from
rpc_run_task() no longer holds due to commit 25cf32ad5dba ("SUNRPC:
Handle allocation failure in rpc_new_task()").

Fixes: 25cf32ad5dba ('SUNRPC: Handle allocation failure in rpc_new_task()')
Fixes: efe57fd58e1c ('SUNRPC: Remove unreachable error condition')
Signed-off-by: Dan Aloni <dan.aloni@vastdata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Acked-by: NeilBrown <neilb@suse.com>

---
 net/sunrpc/clnt.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2844,6 +2844,8 @@ int rpc_clnt_test_and_add_xprt(struct rp
 
 	task = rpc_call_null_helper(clnt, xprt, NULL, RPC_TASK_ASYNC,
 			&rpc_cb_add_xprt_call_ops, data);
+	if (IS_ERR(task))
+		return PTR_ERR(task);
 
 	rpc_put_task(task);
 success: