Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1410427
| From | Lyude <cpaul@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4/4] drm/atomic: Verify connector->funcs != NULL when clearing states |
| Date | 2016-05-31 19:00 +0200 |
| Message-ID | <rEVbk-5aQ-31@gated-at.bofh.it> (permalink) |
| References | <rEVbj-5aQ-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Unfortunately since we don't have Dave's connector refcounting patch
here yet, it's very possible that drm_atomic_state_default_clear() could
get called by intel_display_resume() when
intel_dp_mst_destroy_connector() isn't completely finished destroying an
mst connector, but has already finished setting connector->funcs to
NULL. As such, we need to treat the connector like it's already been
destroyed and just skip it, otherwise we'll end up dereferencing a NULL
pointer.
This fix is only required for 4.6 and below. David Airlie's patchseries
for 4.7 to add connector reference counting provides a more proper fix
for this.
Changes since v1:
- Fix leftover whitespace
Upstream fix: 0552f7651bc2 ("drm/i915/mst: use reference counted
connectors. (v3)")
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Lyude <cpaul@redhat.com>
---
drivers/gpu/drm/drm_atomic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 8ee1db8..d307d96 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -139,7 +139,7 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state)
for (i = 0; i < state->num_connector; i++) {
struct drm_connector *connector = state->connectors[i];
- if (!connector)
+ if (!connector || !connector->funcs)
continue;
/*
--
2.5.5
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 4/4] drm/atomic: Verify connector->funcs != NULL when clearing states Lyude <cpaul@redhat.com> - 2016-05-31 19:00 +0200
csiph-web