memory allocated by kmem_cache_alloc() in alloc_cache_entry()
should be freed using kmem_cache_free(), not kfree().
Fixes: 34a44fb160f9 ("cifs: Add DFS cache routines")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Steve French <[email protected]>
Reviewed-by: Aurelien Aptel <[email protected]>
ce->ce_path = kstrdup_const(path, GFP_KERNEL);
if (!ce->ce_path) {
- kfree(ce);
+ kmem_cache_free(dfs_cache_slab, ce);
return ERR_PTR(-ENOMEM);
}
INIT_HLIST_NODE(&ce->ce_hlist);
rc = copy_ref_data(refs, numrefs, ce, NULL);
if (rc) {
kfree(ce->ce_path);
- kfree(ce);
+ kmem_cache_free(dfs_cache_slab, ce);
ce = ERR_PTR(rc);
}
return ce;