Skip to contentSkip to conversation

erofs-utils: fix an uninitialized variable

PATCH New Lianjun Huang 3 participants 3 messages May 23, 2019 – May 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 erofs-utils: fix an uninitialized variable

This fixes a building failure caused by using a variable before initialization.

Signed-off-by Lianjun Huang <huanglianjun at vivo.com>
---
 mkfs/erofs_cache.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mkfs/erofs_cache.c +1 -1
index 5bb293b..0d7acf7 100644
@@ -142,7 +142,7 @@ int erofs_flush_all_blocks(void)
 	char *erofs_blk_buf;
 	char *pbuf;
 	int count;
-	int ret;
+	int ret = 0;
 
 	erofs_blk_buf = malloc(EROFS_BLKSIZE);
 	if (!erofs_blk_buf)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 erofs-utils: fix an uninitialized variable

Hi Lianjun,

Quoted 3 lines · Lianjun Huang

This fixes a building failure caused by using a variable before initialization.

Signed-off-by Lianjun Huang <huanglianjun at vivo.com>

Thanks for your patch. I will apply this patch to the current mkfs-dev branch this evening.

p.s. could you have some time to take a look at erofs-mkfs and do some test/fixes on the new code,
https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/log/?h=experimental

I plan to send new mkfs code to mailing list for review, and switch new erofs-mkfs from experimental to dev branch, and mark the current mkfs obsoleted since the new mkfs is more cleaner, powerful (with designs to support the upcoming erofs features) and seems already stable...

Thanks,
Gao Xiang

Quoted 18 lines
---
 mkfs/erofs_cache.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mkfs/erofs_cache.c +1 -1
index 5bb293b..0d7acf7 100644
@@ -142,7 +142,7 @@ int erofs_flush_all_blocks(void)
 	char *erofs_blk_buf;
 	char *pbuf;
 	int count;
-	int ret;
+	int ret = 0;
 
 	erofs_blk_buf = malloc(EROFS_BLKSIZE);
 	if (!erofs_blk_buf)
#2 lore raw

PATCH 1/1 erofs-utils: fix an uninitialized variable

In reply to Lianjun Huang
Quoted 3 lines · Lianjun Huang

This fixes a building failure caused by using a variable before initialization.

Signed-off-by Lianjun Huang <huanglianjun at vivo.com>
Reviewed-by Chao Yu <yuchao0 at huawei.com>

Thanks,