Re: [PATCH] reiserfs: Use kstrdup instead of kmalloc/strcpy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun 10-03-13 15:06:23, Ionut-Gabriel Radu wrote:
> Signed-off-by: Ionut-Gabriel Radu <ihonius@xxxxxxxxx>
  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@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux