Signed-off-by: Thomas Graf <tgraf@suug.ch>
ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops);
if (!ops)
BUG();
- else
+ else {
+ nl_cache_get(cache);
ops->co_major_cache = cache;
+ }
}
/**
ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops);
if (!ops)
BUG();
- else if (ops->co_major_cache == cache)
+ else if (ops->co_major_cache == cache) {
+ nl_cache_free(ops->co_major_cache);
ops->co_major_cache = NULL;
+ }
}
struct nl_cache *__nl_cache_mngt_require(const char *name)