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.

mtd: maps: Fix refcount leak in of_flash_probe_versatile

of_find_matching_node_and_match() 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: b0afd44bc192 ("mtd: physmap_of: add a hook for Versatile write protection")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220523140205.48625-1-linmq006@gmail.com

authored by

Miaoqian Lin and committed by
Miquel Raynal
33ec82a6 f2906aa8

+1
+1
drivers/mtd/maps/physmap-versatile.c
··· 207 207 208 208 versatile_flashprot = (enum versatile_flashprot)devid->data; 209 209 rmap = syscon_node_to_regmap(sysnp); 210 + of_node_put(sysnp); 210 211 if (IS_ERR(rmap)) 211 212 return PTR_ERR(rmap); 212 213