From 1fe536aa37f7f3b2a4155f9c7d6c86abce56d130 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 4 Dec 2023 21:17:03 +0800 Subject: [PATCH] sleep: reduce the scope of hibernation_device --- src/sleep/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 21af3e9e52..6ff012d447 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -218,7 +218,6 @@ static int execute( NULL }; - _cleanup_(hibernation_device_done) HibernationDevice hibernation_device = {}; _cleanup_close_ int state_fd = -EBADF; int r; @@ -238,6 +237,7 @@ static int execute( /* Configure hibernation settings if we are supposed to hibernate */ if (sleep_operation_is_hibernation(operation)) { + _cleanup_(hibernation_device_done) HibernationDevice hibernation_device = {}; bool resume_set; r = find_suitable_hibernation_device(&hibernation_device); -- 2.25.1