Hi Anton,
On 5/16/25 5:25 PM, ant.v.morya...@gmail.com wrote:
From: Anton Moryakov <ant.v.morya...@gmail.com>
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 <ant.v.morya...@gmail.com>
Looks fine to me
Reviewed-by: Quentin Schulz <quentin.sch...@cherry.de>
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