staging/lustre/mdc: fix issue found by Klocwork Insight tool
authorDmitry Eremin <dmitry.eremin@intel.com>
Sun, 27 Apr 2014 17:06:54 +0000 (13:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Apr 2014 17:27:11 +0000 (10:27 -0700)
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>
drivers/staging/lustre/lustre/mdc/mdc_reint.c

index 19f20c1b66b9338fa1bcc9230521c0008e07f8c7..08e80940ee4dc8cac3e165579463468e49b0d6ff 100644 (file)
@@ -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;