* [bug report] drm/amd/display: Call into DC once per multiplane flip
@ 2019-02-05 8:47 Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2019-02-05 8:47 UTC (permalink / raw)
To: David.Francis-5C7GfCeVMHo; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Hello David Francis,
This is a semi-automatic email about new static checker warnings.
The patch 8a48b44cd00f: "drm/amd/display: Call into DC once per
multiplane flip" from Dec 11, 2018, leads to the following Smatch
complaint:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4763 amdgpu_dm_commit_planes()
warn: variable dereferenced before check 'acrtc_state->stream' (see line 4748)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c
4747
4748 stream_status = dc_stream_get_status(acrtc_state->stream);
^^^^^^^^^^^^^^^^^^^
New unchecked dereference inside function.
4749 if (!stream_status) {
4750 DRM_ERROR("No stream status for CRTC: id=%d\n",
4751 acrtc_attach->crtc_id);
4752 continue;
4753 }
4754
4755 surface = stream_status->plane_states[0];
4756 flip->surface_updates[flip_count].surface = surface;
4757 if (!flip->surface_updates[flip_count].surface) {
4758 DRM_ERROR("No surface for CRTC: id=%d\n",
4759 acrtc_attach->crtc_id);
4760 continue;
4761 }
4762
4763 if (acrtc_state->stream)
^^^^^^^^^^^^^^^^^^^
New check is too late.
4764 update_freesync_state_on_stream(
4765 dm,
regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
* [bug report] drm/amd/display: Call into DC once per multiplane flip
@ 2019-02-19 8:11 Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2019-02-19 8:11 UTC (permalink / raw)
To: David.Francis; +Cc: dri-devel, amd-gfx
Hello David Francis,
This is a semi-automatic email about new static checker warnings.
The patch 8a48b44cd00f: "drm/amd/display: Call into DC once per
multiplane flip" from Dec 11, 2018, leads to the following Smatch
complaint:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4845 amdgpu_dm_commit_planes()
error: we previously assumed 'acrtc_state->stream' could be null (see line 4833)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c
4832
4833 if (acrtc_state->stream) {
^^^^^^^^^^^^^^^^^^^
Check for NULL
4834
4835 if (acrtc_state->freesync_timing_changed)
4836 flip->stream_update.adjust =
4837 &acrtc_state->stream->adjust;
4838
4839 if (acrtc_state->freesync_vrr_info_changed)
4840 flip->stream_update.vrr_infopacket =
4841 &acrtc_state->stream->vrr_infopacket;
4842 }
4843
4844 mutex_lock(&dm->dc_lock);
4845 dc_commit_updates_for_stream(dm->dc,
4846 flip->surface_updates,
4847 flip_count,
4848 acrtc_state->stream,
^^^^^^^^^^^^^^^^^^^
Unchecked dereference. Also the indenting is weird.
4849 &flip->stream_update,
4850 dc_state);
4851 mutex_unlock(&dm->dc_lock);
4852 }
4853
4854 if (planes_count) {
regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-19 8:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-19 8:11 [bug report] drm/amd/display: Call into DC once per multiplane flip Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2019-02-05 8:47 Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.