Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 d8f3de0d2412 ("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 0e91398f2a5d ("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: d8f3de0d2412 ("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>

authored by

Lukas Wunner and committed by
Juergen Gross
f770c3d8 3fcc8e14

+2 -1
+2 -1
drivers/xen/manage.c
··· 110 110 err = dpm_suspend_start(PMSG_FREEZE); 111 111 if (err) { 112 112 pr_err("%s: dpm_suspend_start %d\n", __func__, err); 113 - goto out_thaw; 113 + goto out_resume_end; 114 114 } 115 115 116 116 printk(KERN_DEBUG "suspending xenstore...\n"); ··· 150 150 else 151 151 xs_suspend_cancel(); 152 152 153 + out_resume_end: 153 154 dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE); 154 155 155 156 out_thaw: