mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ionut-Gabriel Radu <ihonius@gmail.com>
To: viro@zeniv.linux.org.uk
Cc: jack@suse.cz, artem.bityutskiy@linux.intel.com,
	shaggy@kernel.org, akpm@linux-foundation.org,
	reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ionut-Gabriel Radu <ihonius@gmail.com>
Subject: [PATCH] reiserfs: Use kstrdup instead of kmalloc/strcpy
Date: Sun, 10 Mar 2013 15:06:23 +0200	[thread overview]
Message-ID: <1362920783-17093-1-git-send-email-ihonius@gmail.com> (raw)

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


             reply	other threads:[~2013-03-10 13:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-10 13:06 Ionut-Gabriel Radu [this message]
2013-03-11 13:55 ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362920783-17093-1-git-send-email-ihonius@gmail.com \
    --to=ihonius@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=shaggy@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®