Merge branches 'acpi-battery', 'acpi-video' and 'acpi-misc'
[sfrench/cifs-2.6.git] / drivers / thermal / imx_sc_thermal.c
index 8d76dbfde6a9ff425f3e24b2c6e388bfad5649ba..331a241eb0ef315606b24bb7c841706d21c710b1 100644 (file)
@@ -94,8 +94,8 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
                sensor = devm_kzalloc(&pdev->dev, sizeof(*sensor), GFP_KERNEL);
                if (!sensor) {
                        of_node_put(child);
-                       of_node_put(sensor_np);
-                       return -ENOMEM;
+                       ret = -ENOMEM;
+                       goto put_node;
                }
 
                ret = thermal_zone_of_get_sensor_id(child,
@@ -124,7 +124,9 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
                        dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
        }
 
+put_node:
        of_node_put(sensor_np);
+       of_node_put(np);
 
        return ret;
 }