diff --git a/lustre/ptlrpc/llog_net.c b/lustre/ptlrpc/llog_net.c
index 88285df84c7307695279e0af0f90f58c01f8bfbd..5a16b56c7f842f67d9def817ac92719ff379f536 100644
--- a/lustre/ptlrpc/llog_net.c
+++ b/lustre/ptlrpc/llog_net.c
@@ -164,9 +164,11 @@ int llog_receptor_accept(struct llog_ctxt *ctxt, struct obd_import *imp)
         LASSERT(ctxt);
         mutex_down(&ctxt->loc_sem);
         if (ctxt->loc_imp != imp) {
-                CWARN("changing the import %p - %p\n", ctxt->loc_imp, imp);
-                if (ctxt->loc_imp)
+                if (ctxt->loc_imp) {
+                        CWARN("changing the import %p - %p\n",
+                              ctxt->loc_imp, imp);
                         class_import_put(ctxt->loc_imp);
+                }
                 ctxt->loc_imp = class_import_get(imp);
         }
         mutex_up(&ctxt->loc_sem);