Commit 072d3d1acb452f4abd8d3d20af661f2e28854b59
Committed by
Linus Torvalds
1 parent
5869066445
Exists in
master
and in
4 other branches
[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 <mb@bu3sch.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
drivers/char/hw_random/geode-rng.c
| ... | ... | @@ -107,10 +107,14 @@ |
| 107 | 107 | if (err) { |
| 108 | 108 | printk(KERN_ERR PFX "RNG registering failed (%d)\n", |
| 109 | 109 | err); |
| 110 | - goto out; | |
| 110 | + goto err_unmap; | |
| 111 | 111 | } |
| 112 | 112 | out: |
| 113 | 113 | return err; |
| 114 | + | |
| 115 | +err_unmap: | |
| 116 | + iounmap(mem); | |
| 117 | + goto out; | |
| 114 | 118 | } |
| 115 | 119 | |
| 116 | 120 | static void __exit mod_exit(void) |