[PATCH] paravirt: fix error handling in paravirt_disable_iospace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure everything is backed out if it fails.

Signed-off-by: Jeremy Fitzhardinge <[email protected]>

---
 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;
 }


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux