From: Dmitry Eremin Date: Sun, 27 Apr 2014 17:06:54 +0000 (-0400) Subject: staging/lustre/mdc: fix issue found by Klocwork Insight tool X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ba0e1b53726d233360960e7ae7f65b3be32042a9;p=linux-beck.git staging/lustre/mdc: fix issue found by Klocwork Insight tool Pointer 'mod' checked for NULL at line 160 may be dereferenced at line 208. Signed-off-by: Dmitry Eremin Reviewed-on: http://review.whamcloud.com/9387 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-by: Lai Siyao Reviewed-by: John L. Hammond Reviewed-by: Fan Yong Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c index 19f20c1b66b9..08e80940ee4d 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c @@ -199,7 +199,8 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data, *request = req; if (rc && req->rq_commit_cb) { /* Put an extra reference on \var mod on error case. */ - obd_mod_put(*mod); + if (mod != NULL && *mod != NULL) + obd_mod_put(*mod); req->rq_commit_cb(req); } return rc;