Skip to content

Commit aac2f83

Browse files
joehattorivinodkoul
authored andcommitted
soundwire: slave: fix an OF node reference leak in soundwire slave device
When initializing a soundwire slave device, an OF node is stored to the device with refcount incremented. However, the refcount is not decremented in .release(), thus call of_node_put() in sdw_slave_release(). Fixes: a2e4845 ("soundwire: core: add device tree support for slave devices") Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20241205034844.2784964-1-joe@pf.is.s.u-tokyo.ac.jp Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 836c8a2 commit aac2f83

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/soundwire/slave.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ static void sdw_slave_release(struct device *dev)
1313
{
1414
struct sdw_slave *slave = dev_to_sdw_dev(dev);
1515

16+
of_node_put(slave->dev.of_node);
1617
mutex_destroy(&slave->sdw_dev_lock);
1718
kfree(slave);
1819
}

0 commit comments

Comments
 (0)