* [PATCH xf86-video-amdgpu] Bail from drmmode_cm_init if there's no CRTC
@ 2018-09-13 9:47 Michel Dänzer
[not found] ` <20180913094729.2355-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Michel Dänzer @ 2018-09-13 9:47 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Michel Dänzer <michel.daenzer@amd.com>
We would crash due to dereferencing the NULL mode_res->crtc pointer.
Bugzilla: https://bugs.freedesktop.org/107913
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
src/drmmode_display.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 6ef6a98e2..cbda8ad35 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -3198,6 +3198,9 @@ static void drmmode_cm_init(int drm_fd, drmmode_ptr drmmode,
memset(drmmode->cm_prop_ids, 0, sizeof(drmmode->cm_prop_ids));
drmmode->gamma_lut_size = drmmode->degamma_lut_size = 0;
+ if (!mode_res->crtcs)
+ return;
+
/* AMD hardware has color management support on all pipes. It is
* therefore sufficient to only check the first CRTC.
*/
--
2.19.0.rc2
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH xf86-video-amdgpu] Bail from drmmode_cm_init if there's no CRTC
[not found] ` <20180913094729.2355-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-09-13 14:17 ` Deucher, Alexander
0 siblings, 0 replies; 2+ messages in thread
From: Deucher, Alexander @ 2018-09-13 14:17 UTC (permalink / raw)
To: Michel Dänzer, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
[-- Attachment #1.1: Type: text/plain, Size: 1596 bytes --]
Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Michel Dänzer <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
Sent: Thursday, September 13, 2018 5:47:29 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-amdgpu] Bail from drmmode_cm_init if there's no CRTC
From: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>
We would crash due to dereferencing the NULL mode_res->crtc pointer.
Bugzilla: https://bugs.freedesktop.org/107913
Signed-off-by: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>
---
src/drmmode_display.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 6ef6a98e2..cbda8ad35 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -3198,6 +3198,9 @@ static void drmmode_cm_init(int drm_fd, drmmode_ptr drmmode,
memset(drmmode->cm_prop_ids, 0, sizeof(drmmode->cm_prop_ids));
drmmode->gamma_lut_size = drmmode->degamma_lut_size = 0;
+ if (!mode_res->crtcs)
+ return;
+
/* AMD hardware has color management support on all pipes. It is
* therefore sufficient to only check the first CRTC.
*/
--
2.19.0.rc2
_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[-- Attachment #1.2: Type: text/html, Size: 3400 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-13 14:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13 9:47 [PATCH xf86-video-amdgpu] Bail from drmmode_cm_init if there's no CRTC Michel Dänzer
[not found] ` <20180913094729.2355-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-09-13 14:17 ` Deucher, Alexander
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.