Whamcloud - gitweb
LU-4189 mdc: Removed unneeded NULL check 19/12919/5
authorHenri Doreau <henri.doreau@cea.fr>
Wed, 3 Dec 2014 13:51:36 +0000 (14:51 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 28 Apr 2015 15:41:25 +0000 (15:41 +0000)
Do not bother checking the return value of changelog_kuc_hdr()
against NULL since this value was dereferenced earlier.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Change-Id: I34a81e840838e3b50bca0099fb810815b540875e
Reviewed-on: http://review.whamcloud.com/12919
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdc/mdc_request.c

index 3946940..fa1900e 100644 (file)
@@ -1952,10 +1952,10 @@ static int mdc_changelog_send_thread(void *csdata)
        if (cs->cs_buf == NULL)
                GOTO(out, rc = -ENOMEM);
 
-        /* Set up the remote catalog handle */
-        ctxt = llog_get_context(cs->cs_obd, LLOG_CHANGELOG_REPL_CTXT);
-        if (ctxt == NULL)
-                GOTO(out, rc = -ENOENT);
+       /* Set up the remote catalog handle */
+       ctxt = llog_get_context(cs->cs_obd, LLOG_CHANGELOG_REPL_CTXT);
+       if (ctxt == NULL)
+               GOTO(out, rc = -ENOENT);
        rc = llog_open(NULL, ctxt, &llh, NULL, CHANGELOG_CATALOG,
                       LLOG_OPEN_EXISTS);
        if (rc) {
@@ -1975,19 +1975,17 @@ static int mdc_changelog_send_thread(void *csdata)
 
        rc = llog_cat_process(NULL, llh, changelog_kkuc_cb, cs, 0, 0);
 
-        /* Send EOF no matter what our result */
-        if ((kuch = changelog_kuc_hdr(cs->cs_buf, sizeof(*kuch),
-                                      cs->cs_flags))) {
-                kuch->kuc_msgtype = CL_EOF;
-                libcfs_kkuc_msg_put(cs->cs_fp, kuch);
-        }
+       /* Send EOF no matter what our result */
+       kuch = changelog_kuc_hdr(cs->cs_buf, sizeof(*kuch), cs->cs_flags);
+       kuch->kuc_msgtype = CL_EOF;
+       libcfs_kkuc_msg_put(cs->cs_fp, kuch);
 
 out:
        fput(cs->cs_fp);
        if (llh)
                llog_cat_close(NULL, llh);
-        if (ctxt)
-                llog_ctxt_put(ctxt);
+       if (ctxt)
+               llog_ctxt_put(ctxt);
        if (cs->cs_buf)
                OBD_FREE(cs->cs_buf, KUC_CHANGELOG_MSG_MAXSIZE);
        OBD_FREE_PTR(cs);