Skip to content

Commit

Permalink
reiserfs: Use kstrdup instead of kmalloc/strcpy
Browse files Browse the repository at this point in the history
Signed-off-by: Ionut-Gabriel Radu <ihonius@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Ionut-Gabriel Radu authored and Jan Kara committed Mar 11, 2013
1 parent 8d0c2d1 commit af591ad
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/reiserfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,16 +1147,14 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
"on filesystem root.");
return 0;
}
qf_names[qtype] =
kmalloc(strlen(arg) + 1, GFP_KERNEL);
qf_names[qtype] = kstrdup(arg, GFP_KERNEL);
if (!qf_names[qtype]) {
reiserfs_warning(s, "reiserfs-2502",
"not enough memory "
"for storing "
"quotafile name.");
return 0;
}
strcpy(qf_names[qtype], arg);
if (qtype == USRQUOTA)
*mount_options |= 1 << REISERFS_USRQUOTA;
else
Expand Down

0 comments on commit af591ad

Please sign in to comment.