@samitouri / QOSamiQemu / commits / 5e69353ff1

hw/core/loader: fix error handling for get_image_size callers

Check the return value of get_image_size() and report failures for non-mandatory file such as FRU image. - Use ret < 0 to detect failures in getting image size. - No functional changes. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/413 Signed-off-by: Trieu Huynh <vikingtc4@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-ID: <20260318141415.8538-3-vikingtc4@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Trieu Huynh committed Mar 18, 2026 at 23:14 UTC 5e69353ff1ae6f4ed0cd116443044407fbd70ef8
1 file changed +2
hw/ipmi/ipmi_bmc_sim.c
+2
@@ -2561,6 +2561,8 @@ static void ipmi_fru_init(IPMIFru *fru)
2561 g_free(fru->data);
2562 fru->data = NULL;
2563 }
2564 + } else {
2565 + error_report("Could not get file size '%s'", fru->filename);
2566 }
2567
2568 out: