mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 04:47:05 +00:00
hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
commit7f62cf781e
upstream. In gsc_hwmon_get_devtree_pdata(), we should call of_node_get() before the of_find_compatible_node() which will automatically call of_node_put() for the 'from' argument. Fixes:3bce5377ef
("hwmon: Add Gateworks System Controller support") Signed-off-by: Liang He <windhl@126.com> Co-developed-by: Mengda Chen <chenmengda2009@163.com> Signed-off-by: Mengda Chen <chenmengda2009@163.com> Link: https://lore.kernel.org/r/20220916154708.3084515-1-chenmengda2009@163.com Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
868d0def2c
commit
55d4720d06
1 changed files with 1 additions and 0 deletions
|
@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct device *dev)
|
|||
pdata->nchannels = nchannels;
|
||||
|
||||
/* fan controller base address */
|
||||
of_node_get(dev->parent->of_node);
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue