Whamcloud - gitweb
LU-362 Fix error path in lu_kmem_init().
[fs/lustre-release.git] / lustre / obdecho / echo_client.c
index 41e6214..75139df 100644 (file)
@@ -2106,14 +2106,14 @@ int echo_client_init(void)
         lprocfs_echo_init_vars(&lvars);
 
         rc = lu_kmem_init(echo_caches);
-        if (rc == 0)
+        if (rc == 0) {
                 rc = class_register_type(&echo_obd_ops, NULL,
                                          lvars.module_vars,
                                          LUSTRE_ECHO_CLIENT_NAME,
                                          &echo_device_type);
-        if (rc)
-                lu_kmem_fini(echo_caches);
-
+                if (rc)
+                        lu_kmem_fini(echo_caches);
+        }
         return rc;
 }