[PATCH 1/3] btrfs-progs: init variables which are checked later in btrfs-property

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

 



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@xxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux