Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
exfat: Use kmemdup in exfat_symlink()
Browse files Browse the repository at this point in the history
commit f30bd2989b110cfa5050bd98dcf4bc1ec32f9000 upstream.

Use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190905030047.88401-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
  • Loading branch information
YueHaibing authored and arter97 committed Sep 18, 2019
1 parent 6015eed commit 208c52e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1865,12 +1865,11 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, const char *t
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
/* timestamp is already written, so mark_inode_dirty() is unneeded. */

EXFAT_I(inode)->target = kmalloc((len+1), GFP_KERNEL);
EXFAT_I(inode)->target = kmemdup(target, len + 1, GFP_KERNEL);
if (!EXFAT_I(inode)->target) {
err = -ENOMEM;
goto out;
}
memcpy(EXFAT_I(inode)->target, target, len+1);

d_instantiate(dentry, inode);
out:
Expand Down

0 comments on commit 208c52e

Please sign in to comment.