* [PATCH] reiserfs: Use kstrdup instead of kmalloc/strcpy
@ 2013-03-10 13:06 Ionut-Gabriel Radu
2013-03-11 13:55 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Ionut-Gabriel Radu @ 2013-03-10 13:06 UTC (permalink / raw)
To: viro
Cc: jack, artem.bityutskiy, shaggy, akpm, reiserfs-devel,
linux-kernel, Ionut-Gabriel Radu
Signed-off-by: Ionut-Gabriel Radu <ihonius@gmail.com>
---
fs/reiserfs/super.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 194113b..f8a23c3 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1147,8 +1147,7 @@ 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 "
@@ -1156,7 +1155,6 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
"quotafile name.");
return 0;
}
- strcpy(qf_names[qtype], arg);
if (qtype == USRQUOTA)
*mount_options |= 1 << REISERFS_USRQUOTA;
else
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] reiserfs: Use kstrdup instead of kmalloc/strcpy
2013-03-10 13:06 [PATCH] reiserfs: Use kstrdup instead of kmalloc/strcpy Ionut-Gabriel Radu
@ 2013-03-11 13:55 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2013-03-11 13:55 UTC (permalink / raw)
To: Ionut-Gabriel Radu
Cc: viro, jack, artem.bityutskiy, shaggy, akpm, reiserfs-devel, linux-kernel
On Sun 10-03-13 15:06:23, Ionut-Gabriel Radu wrote:
> Signed-off-by: Ionut-Gabriel Radu <ihonius@gmail.com>
Thanks. Added to my tree.
Honza
> ---
> fs/reiserfs/super.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
> index 194113b..f8a23c3 100644
> --- a/fs/reiserfs/super.c
> +++ b/fs/reiserfs/super.c
> @@ -1147,8 +1147,7 @@ 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 "
> @@ -1156,7 +1155,6 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
> "quotafile name.");
> return 0;
> }
> - strcpy(qf_names[qtype], arg);
> if (qtype == USRQUOTA)
> *mount_options |= 1 << REISERFS_USRQUOTA;
> else
> --
> 1.7.10.4
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-11 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-10 13:06 [PATCH] reiserfs: Use kstrdup instead of kmalloc/strcpy Ionut-Gabriel Radu
2013-03-11 13:55 ` Jan Kara
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.