Jeremy Fitzhardinge
2007-Jun-06 15:34 UTC
[PATCH] paravirt: fix error handling in paravirt_disable_iospace
Make sure everything is backed out if it fails. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> --- arch/i386/kernel/paravirt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ==================================================================--- a/arch/i386/kernel/paravirt.c +++ b/arch/i386/kernel/paravirt.c @@ -254,8 +254,11 @@ int paravirt_disable_iospace(void) int ret; ret = request_resource(&ioport_resource, &reserve_ioports); - if (ret == 0) + if (ret == 0) { ret = request_resource(&iomem_resource, &reserve_iomem); + if (ret) + release_resource(&reserve_ioports); + } return ret; }