hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
authorLiang He <windhl@126.com>
Fri, 16 Sep 2022 15:47:08 +0000 (23:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:21 +0000 (12:34 +0200)
commit3281e81ce90cbf1a6723d9c29477fd24fdc1981e
tree2fea14b79c8d45e86b890b3151ea9048508358bc
parente1ab98ec2bc9dc83c9ad086e2a8cdb4ba6a55038
hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API

commit 7f62cf781e6567d59c8935dc8c6068ce2bb904b7 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: 3bce5377ef66 ("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>
drivers/hwmon/gsc-hwmon.c