[igt-dev] [PATCH i-g-t] tools/intel_gpu_top: fix segfault on discrete

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Mon May 29 11:44:50 UTC 2023


in case no display clients ignore display client list

Reported-by: Eero Tamminen <eero.t.tamminen at intel.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 tools/intel_gpu_top.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index a89f13d4..cef1d3c7 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -837,6 +837,9 @@ static struct igt_drm_clients *display_clients(struct igt_drm_clients *clients)
 	struct igt_drm_clients *aggregated;
 	int tmp, num = 0;
 
+	if (!clients)
+		return NULL;
+
 	if (!aggregate_pids)
 		goto out;
 
-- 
2.25.1



More information about the igt-dev mailing list