[PATCH 2/2] bc_send: handle error from bc_alloc_task
Benny Halevy
bhalevy at panasas.com
Thu May 24 12:07:13 EDT 2007
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
net/sunrpc/bc_svc.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/sunrpc/bc_svc.c b/net/sunrpc/bc_svc.c
index fbea284..a8519d5 100644
--- a/net/sunrpc/bc_svc.c
+++ b/net/sunrpc/bc_svc.c
@@ -139,6 +139,10 @@ int bc_send(struct rpc_rqst *req)
* Create an rpc_task to send the data
*/
bc_task = bc_alloc_task(req);
+ if (!bc_task) {
+ err = -ENOMEM;
+ goto out_no_free;
+ }
/*
* Reserve the xprt and then try to send the request across
@@ -158,6 +162,7 @@ int bc_send(struct rpc_rqst *req)
out:
bc_task->tk_rqstp = NULL;
bc_release_task(bc_task);
+out_no_free:
xprt_free_bc_request(req);
return err;
}
--
1.5.1
More information about the pNFS
mailing list