From: Swapnil Pimpale Date: Thu, 28 Apr 2016 01:37:18 +0000 (-0400) Subject: staging: lustre: llite: check ret of ll_prep_md_op_data in ll_dir_filler X-Git-Tag: v4.7-rc1~90^2~303 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fe956e728ade07f10a8a6594b787cab087a00be6;p=karo-tx-linux.git staging: lustre: llite: check ret of ll_prep_md_op_data in ll_dir_filler ll_dir_filler() now checks the returned pointer from ll_prep_md_op_data() using IS_ERR() Signed-off-by: Swapnil Pimpale Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4082 Reviewed-on: http://review.whamcloud.com/8073 Reviewed-by: Dmitry Eremin Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 9463da22cab5..53b037419eda 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -163,6 +163,11 @@ static int ll_dir_filler(void *_hash, struct page *page0) LASSERT(max_pages > 0 && max_pages <= MD_MAX_BRW_PAGES); + op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0, + LUSTRE_OPC_ANY, NULL); + if (IS_ERR(op_data)) + return PTR_ERR(op_data); + page_pool = kcalloc(max_pages, sizeof(page), GFP_NOFS); if (page_pool) { page_pool[0] = page0; @@ -177,8 +182,6 @@ static int ll_dir_filler(void *_hash, struct page *page0) page_pool[npages] = page; } - op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0, - LUSTRE_OPC_ANY, NULL); op_data->op_npages = npages; op_data->op_offset = hash; rc = md_readpage(exp, op_data, page_pool, &request);