lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 035/530] hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
    Date
    From: Liang He <windhl@126.com>

    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 | 1 +
    1 file changed, 1 insertion(+)

    --- a/drivers/hwmon/gsc-hwmon.c
    +++ b/drivers/hwmon/gsc-hwmon.c
    @@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct devic
    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)) {
    dev_err(dev, "fan node without base\n");

    \
     
     \ /
      Last update: 2022-10-24 15:46    [W:4.021 / U:0.328 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site