diff options
author | Olaf Hering <olaf@aepfle.de> | 2006-09-27 00:28:36 +0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-02 14:27:26 +0400 |
commit | 61e37ca22b717a9edc3e5e7c7f3603fad464c76d (patch) | |
tree | ac2dda163316109a98724c517241b36c5d76f959 /drivers/macintosh/via-pmu.c | |
parent | a8ed4f7ec3aa472134d7de6176f823b2667e450b (diff) | |
download | linux-61e37ca22b717a9edc3e5e7c7f3603fad464c76d.tar.xz |
[POWERPC] Avoid NULL pointer in gpio1_interrupt
gpio1_interrupt() may dereference a NULL pointer if ioremap() fails.
But, maybe no gpio interrupt happens in the first place?
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/macintosh/via-pmu.c')
-rw-r--r-- | drivers/macintosh/via-pmu.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index dda03985dcf5..5710e01cef10 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -336,8 +336,10 @@ int __init find_via_pmu(void) if (gaddr != OF_BAD_ADDR) gpio_reg = ioremap(gaddr, 0x10); } - if (gpio_reg == NULL) + if (gpio_reg == NULL) { printk(KERN_ERR "via-pmu: Can't find GPIO reg !\n"); + goto fail_gpio; + } } else pmu_kind = PMU_UNKNOWN; @@ -365,6 +367,9 @@ int __init find_via_pmu(void) return 1; fail: of_node_put(vias); + iounmap(gpio_reg); + gpio_reg = NULL; + fail_gpio: vias = NULL; return 0; } |