]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
misc: fs_loader: Initialize actread variable
authorAlif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Mon, 18 Aug 2025 02:55:02 +0000 (19:55 -0700)
committerTom Rini <trini@konsulko.com>
Tue, 9 Sep 2025 16:30:51 +0000 (10:30 -0600)
Initialize the actread variable to prevent undefined behavior
that can occur if the variable is used before being assigned a
value.

This will help to prevent potential issues, especially if
actread is used (e.g., read, incremented, or returned) before
being explicitly set elsewhere in the code.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
drivers/misc/fs_loader.c

index 60296d55f23631d503bcee87ca2a7e020133b182..1fdfd8636e08ab53206b51b504f89ce340ef2102 100644 (file)
@@ -148,7 +148,7 @@ static int _request_firmware_prepare(struct udevice *dev,
  */
 static int fw_get_filesystem_firmware(struct udevice *dev)
 {
-       loff_t actread;
+       loff_t actread = 0;
        char *storage_interface, *dev_part, *ubi_mtdpart, *ubi_volume;
        int ret;