aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/smu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/smu.c')
-rw-r--r--drivers/macintosh/smu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index b82fcd210bf3..32cb0298f88e 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -484,12 +484,15 @@ int __init smu_init (void)
484 484
485 if (smu_cmdbuf_abs == 0) { 485 if (smu_cmdbuf_abs == 0) {
486 printk(KERN_ERR "SMU: Command buffer not allocated !\n"); 486 printk(KERN_ERR "SMU: Command buffer not allocated !\n");
487 of_node_put(np);
487 return -EINVAL; 488 return -EINVAL;
488 } 489 }
489 490
490 smu = alloc_bootmem(sizeof(struct smu_device)); 491 smu = alloc_bootmem(sizeof(struct smu_device));
491 if (smu == NULL) 492 if (smu == NULL) {
493 of_node_put(np);
492 return -ENOMEM; 494 return -ENOMEM;
495 }
493 memset(smu, 0, sizeof(*smu)); 496 memset(smu, 0, sizeof(*smu));
494 497
495 spin_lock_init(&smu->lock); 498 spin_lock_init(&smu->lock);