Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] drm/amd/display: dead code in MST DPMS-off loop
--

commit 07293e89053ea9e3ce60dc0852be04a50a4ec01e
Author: Arthur Liberman <[email protected]>

    drm/amd/display: fix NULL stream deref on MST DPMS-off

This commit adds a NULL check for streams in the MST DPMS-off loop in
link_set_all_streams_dpms_off_for_link() and adds stream NULL checks in
dc_stream_get_status().

> diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
> b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
> index 48b086d15ab0c..17cb831ce8c48 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
> @@ -177,6 +177,13 @@ void link_set_all_streams_dpms_off_for_link(struct 
> dc_link *link)
>               streams[i] = pipes[i]->stream;
>  
>       for (i = 0; i < count; i++) {
> +             /* A full update can release current_state and NULL remaining
> +              * pipe streams. MST daisy-chains have multiple streams on one
> +              * link, so skip any that disappeared mid-loop.
> +              */
> +             if (!streams[i])
> +                     continue;
> +

[Severity: Low]
Does this check actually protect against mid-loop state changes?

The function link_get_master_pipes_with_dpms_on() guarantees that
pipes[i]->stream is non-NULL when populated, and these pointers are copied
into the local streams[] array before the loop.

Since streams[] is a local array and its elements are not updated inside this
loop, is it possible for streams[i] to become NULL during iteration? It appears
this check might be dead code that provides no runtime protection.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/db9pr03mb73884b0d604ba858636247cf8a...@db9pr03mb7388.eurprd03.prod.outlook.com?part=1

Reply via email to