Skip to contentSkip to conversation

hwrng: fix geode probe error unwind

PATCH New Michael Buesch 1 participant 1 message Jul 26, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwrng: fix geode probe error unwind

The geode hwrng leaks an iomapped resource, if hwrng_register() failes. This fixes it.

drivers/char/hw_random/geode-rng.c +5 -1
Index: linux-2.6/drivers/char/hw_random/geode-rng.c
===================================================================
@@ -107,10 +107,14 @@
 	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)
Signature · 1 line
Greetings Michael.