Hi Anton,

On 5/16/25 5:25 PM, [email protected] wrote:
From: Anton Moryakov <[email protected]>

Prevent file descriptor leaks by properly closing 'fd' and 'new_fd'
when fstat() or write() operations fail.

- Added close(fd) before return in open_for_read() if fstat() fails.
- Added close(new_fd) before return in write_image() if write() fails.
- No close needed if open() fails (fd == -1 is invalid).

Signed-off-by: Anton Moryakov <[email protected]>

Looks fine to me

Reviewed-by: Quentin Schulz <[email protected]>

I believe there are a few others in that file?

inject_region returns without closing, same for write_data, same for the main function with bios_fd at the very least.

Thanks!
Quentin

Reply via email to