mirror of https://gitee.com/openkylin/linux.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 <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>
This commit is contained in:
parent
f85065e534
commit
ba0e1b5372
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue