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.

i2c: fsi: Fix a potential leak in fsi_i2c_probe()

In the commit in Fixes:, when the code has been updated to use an explicit
for loop, instead of for_each_available_child_of_node(), the assumption
that a reference to a device_node structure would be released at each
iteration has been broken.

Now, an explicit of_node_put() is needed to release the reference.

Fixes: 095561f476ab ("i2c: fsi: Create busses for all ports")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: <stable@vger.kernel.org> # v5.3+
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/fd805c39f8de51edf303856103d782138a1633c8.1772382022.git.christophe.jaillet@wanadoo.fr

authored by

Christophe JAILLET and committed by
Andi Shyti
be627abc aa79f996

+1
+1
drivers/i2c/busses/i2c-fsi.c
··· 729 729 rc = i2c_add_adapter(&port->adapter); 730 730 if (rc < 0) { 731 731 dev_err(dev, "Failed to register adapter: %d\n", rc); 732 + of_node_put(np); 732 733 kfree(port); 733 734 continue; 734 735 }