]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (ltc2992) Put fwnode in error case during ->probe()
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Mon, 10 May 2021 10:01:36 +0000 (13:01 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 10 May 2021 15:02:15 +0000 (08:02 -0700)
commit2cad5da3a2fc64102ba057851a2391b29ac09236
treee2f03ec5d1fe707314dc80dc9edbe4d541498a1f
parent4280f3014514a33eba79c575afeeff71c97c65f8
hwmon: (ltc2992) Put fwnode in error case during ->probe()

In each iteration fwnode_for_each_available_child_node() bumps a reference
counting of a loop variable followed by dropping in on a next iteration,

Since in error case the loop is broken, we have to drop a reference count
by ourselves. Do it for port_fwnode in error case during ->probe().

Fixes: bdb55c6913fc ("hwmon: (ltc2992) Add support")
Cc: Alexandru Tachici <alexandru.tachici@analog.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210510100136.3303142-1-andy.shevchenko@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ltc2992.c