Thank you for your contribution! Sashiko AI review found 2 potential issue(s) 
to consider:

New issues:
- [Low] Missing trailing newline in drm_warn() format string.

Pre-existing issues:
- [High] Missing NULL check on the return value of drm_format_info() before 
dereferencing it.
--

--- Patch [1]: [PATCH v2 1/1] drm: use drm_warn() in 
validate_blend_mode_for_alpha_formats() ---
commit e7f907e9d21d7af4bbeb8c955471b68c362de2e1
Author: Leandro Ribeiro <[email protected]>

drm: use drm_warn() in validate_blend_mode_for_alpha_formats()

This commit replaces a WARN() with drm_warn() in 
validate_blend_mode_for_alpha_formats() to prevent fuzzers from stopping when
drivers encounter a pixel format with alpha exposed but no blend mode setup.

> diff --git a/drivers/gpu/drm/drm_mode_config.c 
> b/drivers/gpu/drm/drm_mode_config.c
> index 3bcc7bf0900c4..cff347c723ef0 100644
> --- a/drivers/gpu/drm/drm_mode_config.c
> +++ b/drivers/gpu/drm/drm_mode_config.c
> @@ -869,8 +869,9 @@ static void validate_blend_mode_for_alpha_formats(struct 
> drm_plane *plane)
>       for (i = 0; i < plane->format_count; i++) {
>               fmt = drm_format_info(plane->format_types[i]);
>               if (fmt->has_alpha) {

[Severity: High]
This isn't a bug introduced by this patch, but is it possible for
drm_format_info() to return NULL here?

If a driver exposes an unknown or unsupported format in the format_types
array, drm_format_info() returns NULL, and this line will trigger a NULL
pointer dereference during plane validation.

> -                     WARN(1, "[PLANE:%d:%s] pixel format with alpha exposed 
> but blend mode not setup",
> -                          plane->base.id, plane->name);
> +                     drm_warn(plane->dev,
> +                              "[PLANE:%d:%s] pixel format with alpha exposed 
> but blend mode not setup. Please fix.",

[Severity: Low]
Should this format string end with a newline character?

Without a trailing \n, this warning message might remain buffered or get
concatenated with subsequent unrelated kernel log messages.

> +                              plane->base.id, plane->name);
>                       break;
>               }
>       }

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to