summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre/obdclass
diff options
context:
space:
mode:
authorJohn L. Hammond <john.hammond@intel.com>2014-08-15 12:48:10 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-08-17 09:38:42 -0700
commitf7acd3376387dbf55f76cc77e7dbc870c2719aff (patch)
tree498e5a9eb927cad5d510a6cfaf6ee22e8900ffb7 /drivers/staging/lustre/lustre/obdclass
parentf261f48a39dd3349e5980cdc40604d78ea587ffc (diff)
staging/lustre/clio: reorder initialization in cl_req_alloc()
In cl_req_alloc() ensure that the list heads crq_pages and crq_layers have been initialized before passing the request to cl_req_completion(). This fixes an oops in the error path. Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-on: http://review.whamcloud.com/11009 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5290 Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass')
-rw-r--r--drivers/staging/lustre/lustre/obdclass/cl_io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index 6870ee823736..4265821b8e09 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -1452,12 +1452,13 @@ struct cl_req *cl_req_alloc(const struct lu_env *env, struct cl_page *page,
if (req != NULL) {
int result;
+ req->crq_type = crt;
+ INIT_LIST_HEAD(&req->crq_pages);
+ INIT_LIST_HEAD(&req->crq_layers);
+
OBD_ALLOC(req->crq_o, nr_objects * sizeof(req->crq_o[0]));
if (req->crq_o != NULL) {
req->crq_nrobjs = nr_objects;
- req->crq_type = crt;
- INIT_LIST_HEAD(&req->crq_pages);
- INIT_LIST_HEAD(&req->crq_layers);
result = cl_req_init(env, req, page);
} else
result = -ENOMEM;