[PATCH xf86-video-intel] sna: Add missing NULL check for readdir result in has_connector_backlight

James Clarke jrtc27 at jrtc27.com
Mon Dec 5 11:30:27 UTC 2016


Signed-off-by: James Clarke <jrtc27 at jrtc27.com>
---
 src/sna/sna_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 1d31d008..f6b6e5be 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1033,6 +1033,9 @@ static char *has_connector_backlight(xf86OutputPtr output)
 	DBG(("%s: lookup %s\n", __FUNCTION__, path));
 
 	dir = opendir(path);
+	if (dir == NULL)
+		return NULL;
+
 	while ((de = readdir(dir))) {
 		struct stat st;
 
-- 
2.11.0



More information about the xorg-devel mailing list