When mempool_alloc() is allowed to sleep (GFP_NOIO allows
sleeping) it cannot fail.
So rpc_alloc_task() cannot fail, so rpc_new_task doesn't need
to test for failure.
Consequently rpc_new_task() cannot fail, so the callers
don't need to test.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
        struct rpc_task *task;
 
        task = rpc_new_task(task_setup_data);
-       if (IS_ERR(task))
-               goto out;
 
        rpc_task_set_client(task, task_setup_data->rpc_client);
        rpc_task_set_rpc_message(task, task_setup_data->rpc_message);
 
        atomic_inc(&task->tk_count);
        rpc_execute(task);
-out:
        return task;
 }
 EXPORT_SYMBOL_GPL(rpc_run_task);
         * Create an rpc_task to send the data
         */
        task = rpc_new_task(&task_setup_data);
-       if (IS_ERR(task)) {
-               xprt_free_bc_request(req);
-               goto out;
-       }
        task->tk_rqstp = req;
 
        /*
        WARN_ON_ONCE(atomic_read(&task->tk_count) != 2);
        rpc_execute(task);
 
-out:
        dprintk("RPC: rpc_run_bc_task: task= %p\n", task);
        return task;
 }
 
 
        if (task == NULL) {
                task = rpc_alloc_task();
-               if (task == NULL) {
-                       rpc_release_calldata(setup_data->callback_ops,
-                                       setup_data->callback_data);
-                       return ERR_PTR(-ENOMEM);
-               }
                flags = RPC_TASK_DYNAMIC;
        }