[PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes
Ernst Sjöstrand
ernstp at gmail.com
Mon Jun 24 15:15:42 UTC 2019
Reported by smatch:
amdgpu_dm.c:5637 amdgpu_dm_commit_planes() error: we previously assumed 'acrtc_state->stream' could be null
This seems to be checked for null pretty consistently elsewhere.
Signed-off-by: Ernst Sjöstrand <ernstp at gmail.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 58d7bbc5ada7..360b31a5c028 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5669,7 +5669,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
}
/* Update the planes if changed or disable if we don't have any. */
- if (planes_count || acrtc_state->active_planes == 0) {
+ if ((planes_count || acrtc_state->active_planes == 0) &&
+ acrtc_state->stream) {
if (new_pcrtc_state->mode_changed) {
bundle->stream_update.src = acrtc_state->stream->src;
bundle->stream_update.dst = acrtc_state->stream->dst;
--
2.20.1
More information about the amd-gfx
mailing list