summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-09-03 15:55:18 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-09-03 15:55:18 -0700
commitee03d186124ff6cc27e76fd2054376b1488de5c9 (patch)
tree3a4aeebb3511e6bd9861a173ba20b9f660644e3a
parent7bd8d205ee969452986b80de0dcd82ec9dff8180 (diff)
drm_fb: better handle empty modes/connectors results
Phil tripped over this when his TV powered off in the midst of playing with rototiller over hdmi output. The NULL mode/connector was being supplied as the til_setting_spec_t.preferred value throwing an assert in til_setting_desc_new(). Just detect this exception and return an error.
-rw-r--r--src/drm_fb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drm_fb.c b/src/drm_fb.c
index 0b6e053..a3864d3 100644
--- a/src/drm_fb.c
+++ b/src/drm_fb.c
@@ -159,6 +159,9 @@ static int connector_desc_generator(const til_settings_t *settings, til_setup_t
if (r < 0)
return r;
+ if (!connectors[0])
+ return -ENOENT;
+
r = til_setting_desc_new( settings,
&(til_setting_spec_t){
.name = "DRM connector",
@@ -269,6 +272,9 @@ static int mode_desc_generator(const til_settings_t *settings, til_setup_t *setu
if (r < 0)
return r;
+ if (!modes[0])
+ return -ENOENT;
+
r = til_setting_desc_new( settings,
&(til_setting_spec_t){
.name = "DRM video mode",
© All Rights Reserved