Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mfd: max77620: Fix refcount leak in max77620_initialise_fps

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: 327156c59360 ("mfd: max77620: Add core driver for MAX77620/MAX20024")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220601043222.64441-1-linmq006@gmail.com

authored by

Miaoqian Lin and committed by
Lee Jones
1520669c 34b1a65e

+2
+2
drivers/mfd/max77620.c
··· 419 419 ret = max77620_config_fps(chip, fps_child); 420 420 if (ret < 0) { 421 421 of_node_put(fps_child); 422 + of_node_put(fps_np); 422 423 return ret; 423 424 } 424 425 } 426 + of_node_put(fps_np); 425 427 426 428 config = chip->enable_global_lpm ? MAX77620_ONOFFCNFG2_SLP_LPM_MSK : 0; 427 429 ret = regmap_update_bits(chip->rmap, MAX77620_REG_ONOFFCNFG2,