From 4f53ab16137d99e0d20d955f58c736d0d938a812 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Mon, 9 Jun 2008 22:21:51 +1000 Subject: [PATCH] --- yaml --- r: 98181 b: refs/heads/master c: 958a65f205fdc5ce5461d79376073b89acc51b31 h: refs/heads/master i: 98179: 6c3cc6ff21a2255eb030c97869909036d6019467 v: v3 --- [refs] | 2 +- trunk/drivers/macintosh/therm_adt746x.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index a1926960536e..302cc302c7fa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8b9dba2ce28f64246198704b23f133bed5429e62 +refs/heads/master: 958a65f205fdc5ce5461d79376073b89acc51b31 diff --git a/trunk/drivers/macintosh/therm_adt746x.c b/trunk/drivers/macintosh/therm_adt746x.c index 54f4942a2968..5366dc93fb38 100644 --- a/trunk/drivers/macintosh/therm_adt746x.c +++ b/trunk/drivers/macintosh/therm_adt746x.c @@ -562,18 +562,24 @@ thermostat_init(void) therm_type = ADT7460; else if (of_device_is_compatible(np, "adt7467")) therm_type = ADT7467; - else + else { + of_node_put(np); return -ENODEV; + } prop = of_get_property(np, "hwsensor-params-version", NULL); printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop, (*prop == 1)?"":"un"); - if (*prop != 1) + if (*prop != 1) { + of_node_put(np); return -ENODEV; + } prop = of_get_property(np, "reg", NULL); - if (!prop) + if (!prop) { + of_node_put(np); return -ENODEV; + } /* look for bus either by path or using "reg" */ if (strstr(np->full_name, "/i2c-bus@") != NULL) { @@ -610,6 +616,7 @@ thermostat_init(void) if (of_dev == NULL) { printk(KERN_ERR "Can't register temperatures device !\n"); + of_node_put(np); return -ENODEV; }