Whamcloud - gitweb
LU-6888 osp: check return value in osp_update_request_create()
[fs/lustre-release.git] / lustre / osp / osp_trans.c
index 4d2adc6..91964e7 100644 (file)
@@ -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;
 }