* [PATCH AUTOSEL 6.6 09/11] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers [not found] <20231112132736.175494-1-sashal@kernel.org> @ 2023-11-12 13:27 ` Sasha Levin 2023-11-12 18:00 ` Alex Deucher 2023-11-12 13:27 ` [PATCH AUTOSEL 6.6 10/11] drm/amd/display: Avoid NULL dereference of timing generator Sasha Levin 1 sibling, 1 reply; 5+ messages in thread From: Sasha Levin @ 2023-11-12 13:27 UTC (permalink / raw) To: linux-kernel, stable Cc: Sasha Levin, airlied, dri-devel, amd-gfx, Mario Limonciello, Alex Deucher, Christian König From: Alex Deucher <alexander.deucher@amd.com> [ Upstream commit 49afe91370b86566857a3c2c39612cf098110885 ] For pptable structs that use flexible array sizes, use flexible arrays. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039926 Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org> --- .../drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h | 4 ++-- .../amd/pm/powerplay/hwmgr/vega10_pptable.h | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h index 7a31cfa5e7fb4..df7cab1a571b3 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h @@ -367,7 +367,7 @@ typedef struct _ATOM_Tonga_VCE_State_Record { typedef struct _ATOM_Tonga_VCE_State_Table { UCHAR ucRevId; UCHAR ucNumEntries; - ATOM_Tonga_VCE_State_Record entries[1]; + ATOM_Tonga_VCE_State_Record entries[]; } ATOM_Tonga_VCE_State_Table; typedef struct _ATOM_Tonga_PowerTune_Table { @@ -481,7 +481,7 @@ typedef struct _ATOM_Tonga_Hard_Limit_Record { typedef struct _ATOM_Tonga_Hard_Limit_Table { UCHAR ucRevId; UCHAR ucNumEntries; - ATOM_Tonga_Hard_Limit_Record entries[1]; + ATOM_Tonga_Hard_Limit_Record entries[]; } ATOM_Tonga_Hard_Limit_Table; typedef struct _ATOM_Tonga_GPIO_Table { diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h index 8b0590b834cca..de2926df5ed74 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h @@ -129,7 +129,7 @@ typedef struct _ATOM_Vega10_State { typedef struct _ATOM_Vega10_State_Array { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Vega10_State states[1]; /* Dynamically allocate entries. */ + ATOM_Vega10_State states[]; /* Dynamically allocate entries. */ } ATOM_Vega10_State_Array; typedef struct _ATOM_Vega10_CLK_Dependency_Record { @@ -169,37 +169,37 @@ typedef struct _ATOM_Vega10_GFXCLK_Dependency_Table { typedef struct _ATOM_Vega10_MCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Vega10_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Vega10_MCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Vega10_MCLK_Dependency_Table; typedef struct _ATOM_Vega10_SOCCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Vega10_SOCCLK_Dependency_Table; typedef struct _ATOM_Vega10_DCEFCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Vega10_DCEFCLK_Dependency_Table; typedef struct _ATOM_Vega10_PIXCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Vega10_PIXCLK_Dependency_Table; typedef struct _ATOM_Vega10_DISPCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries.*/ - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Vega10_DISPCLK_Dependency_Table; typedef struct _ATOM_Vega10_PHYCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Vega10_PHYCLK_Dependency_Table; typedef struct _ATOM_Vega10_MM_Dependency_Record { @@ -213,7 +213,7 @@ typedef struct _ATOM_Vega10_MM_Dependency_Record { typedef struct _ATOM_Vega10_MM_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries */ - ATOM_Vega10_MM_Dependency_Record entries[1]; /* Dynamically allocate entries */ + ATOM_Vega10_MM_Dependency_Record entries[]; /* Dynamically allocate entries */ } ATOM_Vega10_MM_Dependency_Table; typedef struct _ATOM_Vega10_PCIE_Record { @@ -225,7 +225,7 @@ typedef struct _ATOM_Vega10_PCIE_Record { typedef struct _ATOM_Vega10_PCIE_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries */ - ATOM_Vega10_PCIE_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Vega10_PCIE_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Vega10_PCIE_Table; typedef struct _ATOM_Vega10_Voltage_Lookup_Record { @@ -235,7 +235,7 @@ typedef struct _ATOM_Vega10_Voltage_Lookup_Record { typedef struct _ATOM_Vega10_Voltage_Lookup_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries */ - ATOM_Vega10_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries */ + ATOM_Vega10_Voltage_Lookup_Record entries[]; /* Dynamically allocate entries */ } ATOM_Vega10_Voltage_Lookup_Table; typedef struct _ATOM_Vega10_Fan_Table { @@ -327,7 +327,7 @@ typedef struct _ATOM_Vega10_VCE_State_Record { typedef struct _ATOM_Vega10_VCE_State_Table { UCHAR ucRevId; UCHAR ucNumEntries; - ATOM_Vega10_VCE_State_Record entries[1]; + ATOM_Vega10_VCE_State_Record entries[]; } ATOM_Vega10_VCE_State_Table; typedef struct _ATOM_Vega10_PowerTune_Table { @@ -427,7 +427,7 @@ typedef struct _ATOM_Vega10_Hard_Limit_Record { typedef struct _ATOM_Vega10_Hard_Limit_Table { UCHAR ucRevId; UCHAR ucNumEntries; - ATOM_Vega10_Hard_Limit_Record entries[1]; + ATOM_Vega10_Hard_Limit_Record entries[]; } ATOM_Vega10_Hard_Limit_Table; typedef struct _Vega10_PPTable_Generic_SubTable_Header { -- 2.42.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH AUTOSEL 6.6 09/11] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers 2023-11-12 13:27 ` [PATCH AUTOSEL 6.6 09/11] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers Sasha Levin @ 2023-11-12 18:00 ` Alex Deucher 2023-11-12 18:51 ` Sasha Levin 0 siblings, 1 reply; 5+ messages in thread From: Alex Deucher @ 2023-11-12 18:00 UTC (permalink / raw) To: Sasha Levin Cc: airlied, linux-kernel, dri-devel, amd-gfx, Alex Deucher, stable, Christian König, Mario Limonciello On Sun, Nov 12, 2023 at 8:27 AM Sasha Levin <sashal@kernel.org> wrote: > > From: Alex Deucher <alexander.deucher@amd.com> > > [ Upstream commit 49afe91370b86566857a3c2c39612cf098110885 ] > > For pptable structs that use flexible array sizes, use flexible arrays. > > Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039926 > Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> > Acked-by: Christian König <christian.koenig@amd.com> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com> > Signed-off-by: Sasha Levin <sashal@kernel.org> I don't think any of these UBSAN flexible array changes are stable material. Alex > --- > .../drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h | 4 ++-- > .../amd/pm/powerplay/hwmgr/vega10_pptable.h | 24 +++++++++---------- > 2 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h > index 7a31cfa5e7fb4..df7cab1a571b3 100644 > --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h > +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h > @@ -367,7 +367,7 @@ typedef struct _ATOM_Tonga_VCE_State_Record { > typedef struct _ATOM_Tonga_VCE_State_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; > - ATOM_Tonga_VCE_State_Record entries[1]; > + ATOM_Tonga_VCE_State_Record entries[]; > } ATOM_Tonga_VCE_State_Table; > > typedef struct _ATOM_Tonga_PowerTune_Table { > @@ -481,7 +481,7 @@ typedef struct _ATOM_Tonga_Hard_Limit_Record { > typedef struct _ATOM_Tonga_Hard_Limit_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; > - ATOM_Tonga_Hard_Limit_Record entries[1]; > + ATOM_Tonga_Hard_Limit_Record entries[]; > } ATOM_Tonga_Hard_Limit_Table; > > typedef struct _ATOM_Tonga_GPIO_Table { > diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h > index 8b0590b834cca..de2926df5ed74 100644 > --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h > +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_pptable.h > @@ -129,7 +129,7 @@ typedef struct _ATOM_Vega10_State { > typedef struct _ATOM_Vega10_State_Array { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries. */ > - ATOM_Vega10_State states[1]; /* Dynamically allocate entries. */ > + ATOM_Vega10_State states[]; /* Dynamically allocate entries. */ > } ATOM_Vega10_State_Array; > > typedef struct _ATOM_Vega10_CLK_Dependency_Record { > @@ -169,37 +169,37 @@ typedef struct _ATOM_Vega10_GFXCLK_Dependency_Table { > typedef struct _ATOM_Vega10_MCLK_Dependency_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries. */ > - ATOM_Vega10_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ > + ATOM_Vega10_MCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ > } ATOM_Vega10_MCLK_Dependency_Table; > > typedef struct _ATOM_Vega10_SOCCLK_Dependency_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries. */ > - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ > + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ > } ATOM_Vega10_SOCCLK_Dependency_Table; > > typedef struct _ATOM_Vega10_DCEFCLK_Dependency_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries. */ > - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ > + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ > } ATOM_Vega10_DCEFCLK_Dependency_Table; > > typedef struct _ATOM_Vega10_PIXCLK_Dependency_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries. */ > - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ > + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ > } ATOM_Vega10_PIXCLK_Dependency_Table; > > typedef struct _ATOM_Vega10_DISPCLK_Dependency_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries.*/ > - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ > + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ > } ATOM_Vega10_DISPCLK_Dependency_Table; > > typedef struct _ATOM_Vega10_PHYCLK_Dependency_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries. */ > - ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ > + ATOM_Vega10_CLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ > } ATOM_Vega10_PHYCLK_Dependency_Table; > > typedef struct _ATOM_Vega10_MM_Dependency_Record { > @@ -213,7 +213,7 @@ typedef struct _ATOM_Vega10_MM_Dependency_Record { > typedef struct _ATOM_Vega10_MM_Dependency_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries */ > - ATOM_Vega10_MM_Dependency_Record entries[1]; /* Dynamically allocate entries */ > + ATOM_Vega10_MM_Dependency_Record entries[]; /* Dynamically allocate entries */ > } ATOM_Vega10_MM_Dependency_Table; > > typedef struct _ATOM_Vega10_PCIE_Record { > @@ -225,7 +225,7 @@ typedef struct _ATOM_Vega10_PCIE_Record { > typedef struct _ATOM_Vega10_PCIE_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries */ > - ATOM_Vega10_PCIE_Record entries[1]; /* Dynamically allocate entries. */ > + ATOM_Vega10_PCIE_Record entries[]; /* Dynamically allocate entries. */ > } ATOM_Vega10_PCIE_Table; > > typedef struct _ATOM_Vega10_Voltage_Lookup_Record { > @@ -235,7 +235,7 @@ typedef struct _ATOM_Vega10_Voltage_Lookup_Record { > typedef struct _ATOM_Vega10_Voltage_Lookup_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; /* Number of entries */ > - ATOM_Vega10_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries */ > + ATOM_Vega10_Voltage_Lookup_Record entries[]; /* Dynamically allocate entries */ > } ATOM_Vega10_Voltage_Lookup_Table; > > typedef struct _ATOM_Vega10_Fan_Table { > @@ -327,7 +327,7 @@ typedef struct _ATOM_Vega10_VCE_State_Record { > typedef struct _ATOM_Vega10_VCE_State_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; > - ATOM_Vega10_VCE_State_Record entries[1]; > + ATOM_Vega10_VCE_State_Record entries[]; > } ATOM_Vega10_VCE_State_Table; > > typedef struct _ATOM_Vega10_PowerTune_Table { > @@ -427,7 +427,7 @@ typedef struct _ATOM_Vega10_Hard_Limit_Record { > typedef struct _ATOM_Vega10_Hard_Limit_Table { > UCHAR ucRevId; > UCHAR ucNumEntries; > - ATOM_Vega10_Hard_Limit_Record entries[1]; > + ATOM_Vega10_Hard_Limit_Record entries[]; > } ATOM_Vega10_Hard_Limit_Table; > > typedef struct _Vega10_PPTable_Generic_SubTable_Header { > -- > 2.42.0 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH AUTOSEL 6.6 09/11] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers 2023-11-12 18:00 ` Alex Deucher @ 2023-11-12 18:51 ` Sasha Levin 2023-11-14 9:31 ` Pavel Machek 0 siblings, 1 reply; 5+ messages in thread From: Sasha Levin @ 2023-11-12 18:51 UTC (permalink / raw) To: Alex Deucher Cc: airlied, linux-kernel, dri-devel, amd-gfx, Alex Deucher, stable, Christian König, Mario Limonciello On Sun, Nov 12, 2023 at 01:00:37PM -0500, Alex Deucher wrote: >On Sun, Nov 12, 2023 at 8:27 AM Sasha Levin <sashal@kernel.org> wrote: >> >> From: Alex Deucher <alexander.deucher@amd.com> >> >> [ Upstream commit 49afe91370b86566857a3c2c39612cf098110885 ] >> >> For pptable structs that use flexible array sizes, use flexible arrays. >> >> Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039926 >> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> >> Acked-by: Christian König <christian.koenig@amd.com> >> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> >> Signed-off-by: Sasha Levin <sashal@kernel.org> > >I don't think any of these UBSAN flexible array changes are stable material. I'll drop it, but in general we've been taking kasan/ubsan/kcsan/... annotation fixes since it enables (easier) testing on the LTS trees, and for example finding issues specific to those LTS trees. -- Thanks, Sasha ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH AUTOSEL 6.6 09/11] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers 2023-11-12 18:51 ` Sasha Levin @ 2023-11-14 9:31 ` Pavel Machek 0 siblings, 0 replies; 5+ messages in thread From: Pavel Machek @ 2023-11-14 9:31 UTC (permalink / raw) To: Sasha Levin Cc: airlied, linux-kernel, dri-devel, Alex Deucher, amd-gfx, stable, Christian König, Mario Limonciello [-- Attachment #1: Type: text/plain, Size: 1126 bytes --] Hi! > > > From: Alex Deucher <alexander.deucher@amd.com> > > > > > > [ Upstream commit 49afe91370b86566857a3c2c39612cf098110885 ] > > > > > > For pptable structs that use flexible array sizes, use flexible arrays. > > > > > > Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039926 > > > Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> > > > Acked-by: Christian König <christian.koenig@amd.com> > > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com> > > > Signed-off-by: Sasha Levin <sashal@kernel.org> > > > > I don't think any of these UBSAN flexible array changes are stable material. > > I'll drop it, but in general we've been taking kasan/ubsan/kcsan/... > annotation fixes since it enables (easier) testing on the LTS trees, and > for example finding issues specific to those LTS trees. I believe they should not be in stable, either. In any case, Documentation/process/stable-kernel-rules.rst should be updated, because it contradicts current practice. Best regards, Pavel -- People of Russia, stop Putin before his war on Ukraine escalates. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 6.6 10/11] drm/amd/display: Avoid NULL dereference of timing generator [not found] <20231112132736.175494-1-sashal@kernel.org> 2023-11-12 13:27 ` [PATCH AUTOSEL 6.6 09/11] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers Sasha Levin @ 2023-11-12 13:27 ` Sasha Levin 1 sibling, 0 replies; 5+ messages in thread From: Sasha Levin @ 2023-11-12 13:27 UTC (permalink / raw) To: linux-kernel, stable Cc: Sasha Levin, airlied, amd-gfx, Daniel Wheeler, Hersen Wu, dri-devel, Wayne Lin, Alex Deucher, Jun Lei, christian.koenig From: Wayne Lin <wayne.lin@amd.com> [ Upstream commit b1904ed480cee3f9f4036ea0e36d139cb5fee2d6 ] [Why & How] Check whether assigned timing generator is NULL or not before accessing its funcs to prevent NULL dereference. Reviewed-by: Jun Lei <jun.lei@amd.com> Acked-by: Hersen Wu <hersenxs.wu@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c index 01fe2d2fd2417..ebe571fcefe32 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -582,7 +582,7 @@ uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream) for (i = 0; i < MAX_PIPES; i++) { struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg; - if (res_ctx->pipe_ctx[i].stream != stream) + if (res_ctx->pipe_ctx[i].stream != stream || !tg) continue; return tg->funcs->get_frame_count(tg); @@ -641,7 +641,7 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream, for (i = 0; i < MAX_PIPES; i++) { struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg; - if (res_ctx->pipe_ctx[i].stream != stream) + if (res_ctx->pipe_ctx[i].stream != stream || !tg) continue; tg->funcs->get_scanoutpos(tg, -- 2.42.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-14 9:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231112132736.175494-1-sashal@kernel.org>
2023-11-12 13:27 ` [PATCH AUTOSEL 6.6 09/11] drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers Sasha Levin
2023-11-12 18:00 ` Alex Deucher
2023-11-12 18:51 ` Sasha Levin
2023-11-14 9:31 ` Pavel Machek
2023-11-12 13:27 ` [PATCH AUTOSEL 6.6 10/11] drm/amd/display: Avoid NULL dereference of timing generator Sasha Levin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).