Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[sfrench/cifs-2.6.git] / drivers / hwmon / gsc-hwmon.c
index 1fe37418ff46c9f2a130c85bbc77aaac41956fdc..d64be48f1ef6c51c2490ee633824440b068f00b3 100644 (file)
@@ -269,10 +269,13 @@ gsc_hwmon_get_devtree_pdata(struct device *dev)
        /* fan controller base address */
        fan = of_find_compatible_node(dev->parent->of_node, NULL, "gw,gsc-fan");
        if (fan && of_property_read_u32(fan, "reg", &pdata->fan_base)) {
+               of_node_put(fan);
                dev_err(dev, "fan node without base\n");
                return ERR_PTR(-EINVAL);
        }
 
+       of_node_put(fan);
+
        /* allocate structures for channels and count instances of each type */
        device_for_each_child_node(dev, child) {
                if (fwnode_property_read_string(child, "label", &ch->name)) {