[openwrt/openwrt] mediatek: fit: fix use of uninitialized variable

LEDE Commits lede-commits at lists.infradead.org
Sun Jul 7 06:00:30 PDT 2024


981213 pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2ded54972e5acb6df8c323a173a4d8ff27f9f1a0

commit 2ded54972e5acb6df8c323a173a4d8ff27f9f1a0
Author: Qingfang Deng <qingfang.deng at siflower.com.cn>
AuthorDate: Fri Jun 28 17:01:00 2024 +0800

    mediatek: fit: fix use of uninitialized variable
    
    When building the kernel with -Wmaybe-uninitialized, GCC reports this
    warning:
    
    block/partitions/fit.c: In function 'parse_fit_partitions':
    block/partitions/fit.c:164:3: warning: 'images' may be used uninitialized in this function [-Wmaybe-uninitialized]
      164 |   printk(KERN_ERR "FIT: Cannot find %s node: %d\n", FIT_CONFS_PATH, images);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    It appears to be a copy paste error. It's the "config" variable that is
    supposed to be printed.
    
    Fixes: e6aac8d98f56 ("image: add support for building FIT image with filesystem")
    Signed-off-by: Qingfang Deng <qingfang.deng at siflower.com.cn>
---
 target/linux/mediatek/files/block/partitions/fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mediatek/files/block/partitions/fit.c b/target/linux/mediatek/files/block/partitions/fit.c
index 463cd4e9ab..01b0f42c7c 100644
--- a/target/linux/mediatek/files/block/partitions/fit.c
+++ b/target/linux/mediatek/files/block/partitions/fit.c
@@ -161,7 +161,7 @@ int parse_fit_partitions(struct parsed_partitions *state, u64 fit_start_sector,
 
 	config = fdt_path_offset(fit, FIT_CONFS_PATH);
 	if (config < 0) {
-		printk(KERN_ERR "FIT: Cannot find %s node: %d\n", FIT_CONFS_PATH, images);
+		printk(KERN_ERR "FIT: Cannot find %s node: %d\n", FIT_CONFS_PATH, config);
 		ret = -ENOENT;
 		goto ret_out;
 	}




More information about the lede-commits mailing list