From e2462a1286fb83dd7c0362ac8f88d380c058f1cc Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Thu, 23 Jun 2016 05:17:38 -0400 Subject: [PATCH] LU-6888 osp: check return value in osp_update_request_create() osp_update_request_create() should check the return value of call to osp_object_update_request_create(), and return error if osp_object_update_request_create() failed. Signed-off-by: Niu Yawei Change-Id: I7b5486c94dec81a506402fc99b24a422c09e3c58 Reviewed-on: http://review.whamcloud.com/20941 Reviewed-by: Fan Yong Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin --- lustre/osp/osp_trans.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/osp/osp_trans.c b/lustre/osp/osp_trans.c index 4d2adc6..91964e7 100644 --- a/lustre/osp/osp_trans.c +++ b/lustre/osp/osp_trans.c @@ -187,6 +187,7 @@ osp_current_object_update_request(struct osp_update_request *our) struct osp_update_request *osp_update_request_create(struct dt_device *dt) { struct osp_update_request *our; + int rc; OBD_ALLOC_PTR(our); if (our == NULL) @@ -197,7 +198,11 @@ struct osp_update_request *osp_update_request_create(struct dt_device *dt) INIT_LIST_HEAD(&our->our_list); spin_lock_init(&our->our_list_lock); - osp_object_update_request_create(our, OUT_UPDATE_INIT_BUFFER_SIZE); + rc = osp_object_update_request_create(our, OUT_UPDATE_INIT_BUFFER_SIZE); + if (rc != 0) { + OBD_FREE_PTR(our); + return ERR_PTR(rc); + } return our; } -- 1.8.3.1