diff options
author | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2013-03-21 15:34:21 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2013-03-21 15:34:45 +0100 |
commit | 35b384a00a0c76ea556f55787fccc95ecd51bc0c (patch) | |
tree | 99f20ef09a30a52e6d1366f4387515b5655012f1 | |
parent | 751c7259cf23a29fdd2653881e2db63ce3cf1ca5 (diff) |
drmmode: handle failure of drmModeGetConnector
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
-rw-r--r-- | src/drmmode_display.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 87ab2689..4c50a1b8 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -716,6 +716,8 @@ drmmode_output_detect(xf86OutputPtr output) drmModeFreeConnector(drmmode_output->mode_output); drmmode_output->mode_output = drmModeGetConnector(drmmode->fd, drmmode_output->output_id); + if (!drmmode_output->mode_output) + return XF86OutputStatusDisconnected; switch (drmmode_output->mode_output->connection) { case DRM_MODE_CONNECTED: @@ -749,6 +751,9 @@ drmmode_output_get_modes(xf86OutputPtr output) drmModePropertyPtr props; xf86MonPtr mon = NULL; + if (!koutput) + return NULL; + /* look for an EDID property */ for (i = 0; i < koutput->count_props; i++) { props = drmModeGetProperty(drmmode->fd, koutput->props[i]); |