Commit 199c6bdf authored by Paulo Alcantara (SUSE)'s avatar Paulo Alcantara (SUSE) Committed by Steve French

cifs: Get rid of kstrdup_const()'d paths

The DFS cache API is mostly used with heap allocated strings.
Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 185352ae
...@@ -131,7 +131,7 @@ static inline void flush_cache_ent(struct cache_entry *ce) ...@@ -131,7 +131,7 @@ static inline void flush_cache_ent(struct cache_entry *ce)
return; return;
hlist_del_init_rcu(&ce->hlist); hlist_del_init_rcu(&ce->hlist);
kfree_const(ce->path); kfree(ce->path);
free_tgts(ce); free_tgts(ce);
cache_count--; cache_count--;
call_rcu(&ce->rcu, free_cache_entry); call_rcu(&ce->rcu, free_cache_entry);
...@@ -420,7 +420,7 @@ static struct cache_entry *alloc_cache_entry(const char *path, ...@@ -420,7 +420,7 @@ static struct cache_entry *alloc_cache_entry(const char *path,
if (!ce) if (!ce)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
ce->path = kstrdup_const(path, GFP_KERNEL); ce->path = kstrndup(path, strlen(path), GFP_KERNEL);
if (!ce->path) { if (!ce->path) {
kmem_cache_free(cache_slab, ce); kmem_cache_free(cache_slab, ce);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -430,7 +430,7 @@ static struct cache_entry *alloc_cache_entry(const char *path, ...@@ -430,7 +430,7 @@ static struct cache_entry *alloc_cache_entry(const char *path,
rc = copy_ref_data(refs, numrefs, ce, NULL); rc = copy_ref_data(refs, numrefs, ce, NULL);
if (rc) { if (rc) {
kfree_const(ce->path); kfree(ce->path);
kmem_cache_free(cache_slab, ce); kmem_cache_free(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