Skip to contentSkip to conversation

SUNRPC: Fix the return value of rpc_run_bc_task()

PATCH New Trond Myklebust 1 participant 1 message Mar 19, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SUNRPC: Fix the return value of rpc_run_bc_task()

From: Trond Myklebust <[email protected]>

Currently rpc_run_bc_task() will return NULL if the task allocation failed. However the only caller is bc_send, which assumes that the return value will be an ERR_PTR.

---

 net/sunrpc/clnt.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/sunrpc/clnt.c +1 -0
index 154034b..19c9983 100644
@@ -659,6 +659,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req,
 	task = rpc_new_task(&task_setup_data);
 	if (!task) {
 		xprt_free_bc_request(req);
+		task = ERR_PTR(-ENOMEM);
 		goto out;
 	}
 	task->tk_rqstp = req;