mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
f2fs: replace deprecated strcpy with strscpy
strcpy is deprecated. Kernel docs recommend replacing strcpy with strscpy. The function strcpy() return value isn't used so there shouldn't be an issue replacing with the safer alternative strscpy. Signed-off-by: Daniel Yang <danielyangkang@gmail.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
acff9409dd
commit
789ca0eb47
1 changed files with 10 additions and 2 deletions
|
@ -1172,7 +1172,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
|
|||
break;
|
||||
}
|
||||
|
||||
strcpy(ext[ext_cnt], name);
|
||||
ret = strscpy(ext[ext_cnt], name);
|
||||
if (ret < 0) {
|
||||
kfree(name);
|
||||
return ret;
|
||||
}
|
||||
F2FS_OPTION(sbi).compress_ext_cnt++;
|
||||
kfree(name);
|
||||
break;
|
||||
|
@ -1201,7 +1205,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
|
|||
break;
|
||||
}
|
||||
|
||||
strcpy(noext[noext_cnt], name);
|
||||
ret = strscpy(noext[noext_cnt], name);
|
||||
if (ret < 0) {
|
||||
kfree(name);
|
||||
return ret;
|
||||
}
|
||||
F2FS_OPTION(sbi).nocompress_ext_cnt++;
|
||||
kfree(name);
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue