From: Michael Buesch Date: Sun, 30 Jul 2006 10:04:05 +0000 (-0700) Subject: [PATCH] hwrng: fix geode probe error unwind X-Git-Tag: v2.6.18-rc4~92 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=072d3d1acb452f4abd8d3d20af661f2e28854b59;p=linux-2.6 [PATCH] hwrng: fix geode probe error unwind The geode hwrng leaks an iomapped resource, if hwrng_register() fails. This fixes it. Signed-off-by: Michael Buesch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c index be61f22ee7..d37ced0d13 100644 --- a/drivers/char/hw_random/geode-rng.c +++ b/drivers/char/hw_random/geode-rng.c @@ -107,10 +107,14 @@ found: if (err) { printk(KERN_ERR PFX "RNG registering failed (%d)\n", err); - goto out; + goto err_unmap; } out: return err; + +err_unmap: + iounmap(mem); + goto out; } static void __exit mod_exit(void)