Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] ppmtodtlogo: silent output corruption due to unchecked file writes
--

commit 4ad00a19ffae8a59e9289c4ee762366d9f29a5de
Author: Max Pedraza <[email protected]>

video: logo: add ppmtodtlogo host tool

This commit adds a host tool that converts a PPM image into a devicetree boot
logo node or a binary blob for a reserved memory region.

> diff --git a/drivers/video/logo/ppmtodtlogo.c 
> b/drivers/video/logo/ppmtodtlogo.c
> new file mode 100644
> index 0000000000000..7fded9ce9ba37
> --- /dev/null
> +++ b/drivers/video/logo/ppmtodtlogo.c
[ ... ]
> +static void write_bin(void)
> +{
> +     put_le32(BLOB_MAGIC);
> +     put_le32(logo_width);
> +     put_le32(logo_height);
> +     put_le32(logo_clutsize);
> +     fwrite(logo_clut, 3, logo_clutsize, out);
> +     fwrite(logo_data, 1, logo_width * logo_height, out);

[Severity: Low]
Are we missing error checks on these writes? If the tool runs under a
disk-full condition or encounters another write error, it looks like it
will silently produce truncated binary blobs without reporting an error or
returning a non-zero exit status.

> +}
[ ... ]
> +int main(int argc, char *argv[])
> +{
[ ... ]
> +     if (outputname)
> +             fclose(out);

[Severity: Low]
Could failing to check the return value here ignore buffered write failures?
If a flush fails at the end of the program, it might obscure disk space
issues and leave a corrupted output file while still exiting with a zero
status code.

> +
> +     fprintf(stderr, "%s: %ux%u pixels, %u colours\n", filename, logo_width,
> +             logo_height, logo_clutsize);
> +
> +     return 0;
> +}

-- 
Sashiko AI review · 
https://sashiko.dev/#/patchset/[email protected]?part=7

Reply via email to