diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-09-05 03:00:47 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-05 09:37:31 +0200 |
commit | f30bd2989b110cfa5050bd98dcf4bc1ec32f9000 (patch) | |
tree | a99d10ec5a92fba93added79493df4713f120167 /drivers/staging | |
parent | 981cdf7d577904aef003c878710e479eec60a1be (diff) | |
download | linux-f30bd2989b110cfa5050bd98dcf4bc1ec32f9000.tar.gz linux-f30bd2989b110cfa5050bd98dcf4bc1ec32f9000.tar.bz2 linux-f30bd2989b110cfa5050bd98dcf4bc1ec32f9000.zip |
staging: exfat: Use kmemdup in exfat_symlink()
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/exfat/exfat_super.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index 38b5811fb6c7..da6d3afa1f89 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -2706,12 +2706,11 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, 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); dentry->d_time = GET_IVERSION(dentry->d_parent->d_inode); d_instantiate(dentry, inode); |