aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/nct7802.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/nct7802.c')
-rw-r--r--drivers/hwmon/nct7802.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
index d56f78327619..d1eeef02b6dc 100644
--- a/drivers/hwmon/nct7802.c
+++ b/drivers/hwmon/nct7802.c
@@ -1152,8 +1152,10 @@ static int nct7802_configure_channels(struct device *dev,
for_each_child_of_node(dev->of_node, node) {
err = nct7802_get_channel_config(dev, node, &mode_mask,
&mode_val);
- if (err)
+ if (err) {
+ of_node_put(node);
return err;
+ }
}
}