Commit 50fbc13d authored by Gen Zhang's avatar Gen Zhang Committed by Steve French

dfs_cache: fix a wrong use of kfree in flush_cache_ent()

In flush_cache_ent(), 'ce->ce_path' is allocated by kstrdup_const().
It should be freed by kfree_const(), rather than kfree().
Signed-off-by: default avatarGen Zhang <blackgod016574@gmail.com>
Reviewed-by: default avatarPaulo Alcantara <palcantara@suse.de>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 6457c20e
...@@ -132,7 +132,7 @@ static inline void flush_cache_ent(struct dfs_cache_entry *ce) ...@@ -132,7 +132,7 @@ static inline void flush_cache_ent(struct dfs_cache_entry *ce)
return; return;
hlist_del_init_rcu(&ce->ce_hlist); hlist_del_init_rcu(&ce->ce_hlist);
kfree(ce->ce_path); kfree_const(ce->ce_path);
free_tgts(ce); free_tgts(ce);
dfs_cache_count--; dfs_cache_count--;
call_rcu(&ce->ce_rcu, free_cache_entry); call_rcu(&ce->ce_rcu, free_cache_entry);
...@@ -422,7 +422,7 @@ alloc_cache_entry(const char *path, const struct dfs_info3_param *refs, ...@@ -422,7 +422,7 @@ alloc_cache_entry(const char *path, const struct dfs_info3_param *refs,
rc = copy_ref_data(refs, numrefs, ce, NULL); rc = copy_ref_data(refs, numrefs, ce, NULL);
if (rc) { if (rc) {
kfree(ce->ce_path); kfree_const(ce->ce_path);
kmem_cache_free(dfs_cache_slab, ce); kmem_cache_free(dfs_cache_slab, ce);
ce = ERR_PTR(rc); ce = ERR_PTR(rc);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment