From: Mike Yuan Date: Mon, 4 Dec 2023 13:17:03 +0000 (+0800) Subject: sleep: reduce the scope of hibernation_device X-Git-Tag: v256-rc1~1564^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fe536aa37f7f3b2a4155f9c7d6c86abce56d130;p=thirdparty%2Fsystemd.git sleep: reduce the scope of hibernation_device --- diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 21af3e9e52e..6ff012d4477 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);