diff --git a/lustre/ptlrpc/llog_net.c b/lustre/ptlrpc/llog_net.c
index cd8764889e4a0246ad65e381e55a241c222d2cef..351661b5e21de136dcb44a1701e7a94e221ee03d 100644
--- a/lustre/ptlrpc/llog_net.c
+++ b/lustre/ptlrpc/llog_net.c
@@ -141,9 +141,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);