summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-11-10 23:16:10 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-11-10 23:16:10 +0000
commit5f2e15b7b21b1dccc166e3e99446f3b00caf8fbe (patch)
tree59a2e2fd8142dc111161955094facaf6a34852cf /sys/dev/pci
parent98c739aeda1673adf6140b0b20c28e92452608de (diff)
drm/amd/display: Add null checks for 'stream' and 'plane' before dereferencing
From Srinivasan Shanmugam 10c20d79d59cadfe572480d98cec271a89ffb024 in linux-6.6.y/6.6.60 15c2990e0f0108b9c3752d7072a97d45d4283aea in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c b/sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c
index d59af329d00..ba4a1e7f196 100644
--- a/sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c
+++ b/sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c
@@ -735,6 +735,9 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable)
stream = dc->current_state->streams[0];
plane = (stream ? dc->current_state->stream_status[0].plane_states[0] : NULL);
+ if (!stream || !plane)
+ return false;
+
if (stream && plane) {
cursor_cache_enable = stream->cursor_position.enable &&
plane->address.grph.cursor_cache_addr.quad_part;