Whamcloud - gitweb
LU-760 obdecho: initialization and awk problem
[fs/lustre-release.git] / lustre / obdecho / echo_client.c
index 512ad9b..41e6214 100644 (file)
@@ -28,6 +28,9 @@
 /*
  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2011 Whamcloud, Inc.
+ *
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -2101,10 +2104,16 @@ int echo_client_init(void)
         int rc;
 
         lprocfs_echo_init_vars(&lvars);
-        rc = class_register_type(&echo_obd_ops, NULL, lvars.module_vars,
-                                 LUSTRE_ECHO_CLIENT_NAME, &echo_device_type);
+
+        rc = lu_kmem_init(echo_caches);
         if (rc == 0)
-                lu_kmem_init(echo_caches);
+                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);
+
         return rc;
 }