Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] drm/amd/display: memory leak in dm_helpers_read_local_edid()
  [1]
--

commit cb81c7873176d93f0193d77abe7f41c76b00d56d
Author: Dave Airlie <[email protected]>

drm/amd/display/amdgpu_dm: Use DC accessors in plane/crtc/helpers paths

This commit replaces direct struct dc member dereferences with DC
accessor functions across amdgpu_dm_plane.c, amdgpu_dm_crtc.c, and
amdgpu_dm_helpers.c.

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index 3067ac5bb0cd0..02a8cfde9f1aa 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

[ ... ]

> @@ -1291,8 +1294,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
>       else
>               ddc = &aconnector->i2c->base;
>  
> -     if (link->dc->hwss.prepare_ddc)
> -             link->dc->hwss.prepare_ddc(link);
> +     dc_prepare_ddc(link);
>  
>       dm_helpers_wait_for_edid_ready(link, ddc);
>  

[Severity: Medium]
This problem wasn't introduced by this patch, but does
dm_helpers_read_local_edid() leak drm_edid [1] when returning
EDID_BAD_INPUT?

Later in the retry loop, if the raw EDID check or length validation fails,
the function returns without calling drm_edid_free(drm_edid):

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c:dm_helpers_read_local_edid()
 {
        ...
                if (!edid || !connector->edid_blob_ptr ||
                    connector->edid_blob_ptr->length > 
sizeof(sink->dc_edid.raw_edid))
                        return EDID_BAD_INPUT;
        ...
                drm_edid_free(drm_edid);
        ...
}

[1] https://sashiko.dev/#/bug/linux-5db7be8c-2e59-46d2-b3bf-37e1b52f73e4

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

Reply via email to