提交 66ae4d56 编写于 作者: W Wan Jiabing 提交者: Guenter Roeck

hwmon: (tmp421) Add of_node_put() before return

Fix following coccicheck warning:
./drivers/hwmon/tmp421.c:416:1-23: WARNING: Function
for_each_child_of_node should have of_node_put() before return.

Early exits from for_each_child_of_node should decrement the
node reference counter.
Signed-off-by: NWan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20211018121538.16482-1-wanjiabing@vivo.comSigned-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 efb389b8
...@@ -418,9 +418,11 @@ static int tmp421_probe_from_dt(struct i2c_client *client, struct tmp421_data *d ...@@ -418,9 +418,11 @@ static int tmp421_probe_from_dt(struct i2c_client *client, struct tmp421_data *d
continue; continue;
err = tmp421_probe_child_from_dt(client, child, data); err = tmp421_probe_child_from_dt(client, child, data);
if (err) if (err) {
of_node_put(child);
return err; return err;
} }
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册