/*
* 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/
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;
}