projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
981cdf7
)
staging: exfat: Use kmemdup in exfat_symlink()
author
YueHaibing
<yuehaibing@huawei.com>
Thu, 5 Sep 2019 03:00:47 +0000
(
03:00
+0000)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 5 Sep 2019 07:37:31 +0000
(09:37 +0200)
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>
drivers/staging/exfat/exfat_super.c
patch
|
blob
|
history
diff --git
a/drivers/staging/exfat/exfat_super.c
b/drivers/staging/exfat/exfat_super.c
index
38b5811
..
da6d3af
100644
(file)
--- 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 = km
alloc(len+
1, GFP_KERNEL);
+ EXFAT_I(inode)->target = km
emdup(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);