[igt-dev] [PATCH i-g-t 1/3] runner: Make sure we don't close watchdogs twice

Arkadiusz Hiler arkadiusz.hiler at intel.com
Tue Jul 9 12:23:43 UTC 2019


Setting the watchdog fd lists to NULL for extra fireworks if accessed
unintentionally.

Cc: Petri Latvala <petri.latvala at intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
 runner/executor.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/runner/executor.c b/runner/executor.c
index 7a7e29d9..af02c5a8 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -46,6 +46,10 @@ static void close_watchdogs(struct settings *settings)
 	for (i = 0; i < watchdogs.num_dogs; i++) {
 		__close_watchdog(watchdogs.fds[i]);
 	}
+
+	free(watchdogs.fds);
+	watchdogs.num_dogs = 0;
+	watchdogs.fds = NULL;
 }
 
 static void close_watchdogs_atexit(void)
-- 
2.21.0



More information about the igt-dev mailing list