gpu-kms: Don't crash if drmModeGetResources returns NULL
authorAaron Plattner <aplattner@nvidia.com>
Thu, 19 Jul 2018 17:51:34 +0000 (10:51 -0700)
committerSimon McVittie <smcv@debian.org>
Tue, 31 Jul 2018 14:35:03 +0000 (15:35 +0100)
commitdfdc270cef157636aedd2cdc65cfac6ffabd13b0
tree7337b7d3b7b569db2ce7785bee0ce4e2b981cb9e
parentc2c5bc0836aa9662e0d419b77b086daac98d90e5
gpu-kms: Don't crash if drmModeGetResources returns NULL

DRM drivers can be opened by meta_launcher_open_restricted() even if they don't
implement modesetting. However, drmModeGetResources() will return NULL.

Check whether that happened in meta_gpu_kms_new() and return with an error
instead of crashing.

Fixes #223.

Applied-Upstream: https://gitlab.gnome.org/GNOME/mutter/commit/62660bbd15
Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/223
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1767956

Gbp-Pq: Name gpu-kms-Don-t-crash-if-drmModeGetResources-returns-N.patch
src/backends/native/meta-gpu-kms.c