aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/via-pmu.c
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2006-09-26 16:28:36 -0400
committerPaul Mackerras <paulus@samba.org>2006-10-02 06:27:26 -0400
commit61e37ca22b717a9edc3e5e7c7f3603fad464c76d (patch)
treeac2dda163316109a98724c517241b36c5d76f959 /drivers/macintosh/via-pmu.c
parenta8ed4f7ec3aa472134d7de6176f823b2667e450b (diff)
[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.c7
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)
336 if (gaddr != OF_BAD_ADDR) 336 if (gaddr != OF_BAD_ADDR)
337 gpio_reg = ioremap(gaddr, 0x10); 337 gpio_reg = ioremap(gaddr, 0x10);
338 } 338 }
339 if (gpio_reg == NULL) 339 if (gpio_reg == NULL) {
340 printk(KERN_ERR "via-pmu: Can't find GPIO reg !\n"); 340 printk(KERN_ERR "via-pmu: Can't find GPIO reg !\n");
341 goto fail_gpio;
342 }
341 } else 343 } else
342 pmu_kind = PMU_UNKNOWN; 344 pmu_kind = PMU_UNKNOWN;
343 345
@@ -365,6 +367,9 @@ int __init find_via_pmu(void)
365 return 1; 367 return 1;
366 fail: 368 fail:
367 of_node_put(vias); 369 of_node_put(vias);
370 iounmap(gpio_reg);
371 gpio_reg = NULL;
372 fail_gpio:
368 vias = NULL; 373 vias = NULL;
369 return 0; 374 return 0;
370} 375}