]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shutdown: explicitly close watchdog with disarm=false before we destroy watchdog...
authorLennart Poettering <lennart@poettering.net>
Wed, 29 May 2024 15:40:28 +0000 (17:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 May 2024 15:42:02 +0000 (17:42 +0200)
Otherwise we'll close the device disarming it as side-effect of
watchdog_free_device(), which is not intended. Hence, let's close the fd
first explicitly leaving it armed.

Fixes: #33075
src/shutdown/shutdown.c

index 67f44e16e9cee86b65c123e8d63bc39b19b2ef1a..d998bc5473aad9b4158a224c1d5e6cf78bf8359c 100644 (file)
@@ -561,7 +561,10 @@ int main(int argc, char *argv[]) {
         }
 
         /* We're done with the watchdog. Note that the watchdog is explicitly not stopped here. It remains
-         * active to guard against any issues during the rest of the shutdown sequence. */
+         * active to guard against any issues during the rest of the shutdown sequence. Note that we
+         * explicitly close the device with disarm=false here, before releasing the rest of the watchdog
+         * data. */
+        watchdog_close(/* disarm= */ false);
         watchdog_free_device();
 
         arguments[0] = NULL; /* Filled in by execute_directories(), when needed */