summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorDmitry Eremin <dmitry.eremin@intel.com>2014-04-27 17:06:54 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-27 17:27:11 (GMT)
commitba0e1b53726d233360960e7ae7f65b3be32042a9 (patch)
tree77bc2f14c95b539bf2860fa9294c6074a9c43ae1 /drivers/staging
parentf85065e534fe8ba6de9b3443c4beacbc3a6ec32d (diff)
downloadlinux-ba0e1b53726d233360960e7ae7f65b3be32042a9.tar.xz
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 <dmitry.eremin@intel.com> Reviewed-on: http://review.whamcloud.com/9387 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Fan Yong <fan.yong@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')
-rw-r--r--drivers/staging/lustre/lustre/mdc/mdc_reint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
index 19f20c1..08e8094 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;