Skip to content

Commit af591ad

Browse files
ionutRDjankara
authored andcommitted
reiserfs: Use kstrdup instead of kmalloc/strcpy
Signed-off-by: Ionut-Gabriel Radu <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 8d0c2d1 commit af591ad

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/reiserfs/super.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,16 +1147,14 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
11471147
"on filesystem root.");
11481148
return 0;
11491149
}
1150-
qf_names[qtype] =
1151-
kmalloc(strlen(arg) + 1, GFP_KERNEL);
1150+
qf_names[qtype] = kstrdup(arg, GFP_KERNEL);
11521151
if (!qf_names[qtype]) {
11531152
reiserfs_warning(s, "reiserfs-2502",
11541153
"not enough memory "
11551154
"for storing "
11561155
"quotafile name.");
11571156
return 0;
11581157
}
1159-
strcpy(qf_names[qtype], arg);
11601158
if (qtype == USRQUOTA)
11611159
*mount_options |= 1 << REISERFS_USRQUOTA;
11621160
else

0 commit comments

Comments
 (0)