All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Subject: [PATCH 1/3] btrfs-progs: init variables which are checked later in btrfs-property
Date: Thu, 31 Jul 2014 11:23:42 +0800	[thread overview]
Message-ID: <1406777024-7647-1-git-send-email-guihc.fnst@cn.fujitsu.com> (raw)

The local variable @object etc. in btrfs-property get/set functions
are to be checked whether to be NULL or not, but the @parse_args()
don't guarantee to assign a value to it, so it is better to init
it to NULL.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
---
 cmds-property.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmds-property.c b/cmds-property.c
index 9c4eb92..90c7603 100644
--- a/cmds-property.c
+++ b/cmds-property.c
@@ -389,7 +389,7 @@ static void parse_args(int argc, char **argv,
 static int cmd_get(int argc, char **argv)
 {
 	int ret;
-	char *object;
+	char *object = NULL;
 	char *name = NULL;
 	int types = 0;
 
@@ -413,9 +413,9 @@ static int cmd_get(int argc, char **argv)
 static int cmd_set(int argc, char **argv)
 {
 	int ret;
-	char *object;
-	char *name;
-	char *value;
+	char *object = NULL;
+	char *name = NULL;
+	char *value = NULL;
 	int types = 0;
 
 	if (check_argc_min(argc, 4) || check_argc_max(argc, 6))
-- 
1.8.1.4


             reply	other threads:[~2014-07-31  3:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31  3:23 Gui Hecheng [this message]
2014-07-31  3:23 ` [PATCH 2/3] btrfs-progs: remove unnecessary return value check in btrfs-property Gui Hecheng
2014-07-31  3:23 ` [PATCH 3/3] btrfs-progs: fix improper return value check for is_existing_blk_or_reg_file Gui Hecheng

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=1406777024-7647-1-git-send-email-guihc.fnst@cn.fujitsu.com \
    --to=guihc.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 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.