Skip to content

Commit f770c3d

Browse files
l1kjgross1
authored andcommitted
xen/manage: Fix suspend error path
The device power management API has the following asymmetry: * dpm_suspend_start() does not clean up on failure (it requires a call to dpm_resume_end()) * dpm_suspend_end() does clean up on failure (it does not require a call to dpm_resume_start()) The asymmetry was introduced by commit d8f3de0 ("Suspend-related patches for 2.6.27") in June 2008: It removed a call to device_resume() from device_suspend() (which was later renamed to dpm_suspend_start()). When Xen began using the device power management API in May 2008 with commit 0e91398 ("xen: implement save/restore"), the asymmetry did not yet exist. But since it was introduced, a call to dpm_resume_end() is missing in the error path of dpm_suspend_start(). Fix it. Fixes: d8f3de0 ("Suspend-related patches for 2.6.27") Signed-off-by: Lukas Wunner <lukas@wunner.de> Cc: stable@vger.kernel.org # v2.6.27 Reviewed-by: "Rafael J. Wysocki (Intel)" <rafael@kernel.org> Signed-off-by: Juergen Gross <jgross@suse.com> Message-ID: <22453676d1ddcebbe81641bb68ddf587fee7e21e.1756990799.git.lukas@wunner.de>
1 parent 3fcc8e1 commit f770c3d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/xen/manage.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static void do_suspend(void)
110110
err = dpm_suspend_start(PMSG_FREEZE);
111111
if (err) {
112112
pr_err("%s: dpm_suspend_start %d\n", __func__, err);
113-
goto out_thaw;
113+
goto out_resume_end;
114114
}
115115

116116
printk(KERN_DEBUG "suspending xenstore...\n");
@@ -150,6 +150,7 @@ static void do_suspend(void)
150150
else
151151
xs_suspend_cancel();
152152

153+
out_resume_end:
153154
dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
154155

155156
out_thaw:

0 commit comments

Comments
 (0)