]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soundwire: slave: fix an OF node reference leak in soundwire slave device
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Thu, 5 Dec 2024 03:48:44 +0000 (12:48 +0900)
committerVinod Koul <vkoul@kernel.org>
Thu, 13 Feb 2025 16:25:57 +0000 (21:55 +0530)
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: a2e484585ad3 ("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>
drivers/soundwire/slave.c

index 4869b073b11c2f3b658992f50c78dd78a2330833..d2d99555ec5a50608530b989ff5206b3b6a67326 100644 (file)
@@ -13,6 +13,7 @@ static void sdw_slave_release(struct device *dev)
 {
        struct sdw_slave *slave = dev_to_sdw_dev(dev);
 
+       of_node_put(slave->dev.of_node);
        mutex_destroy(&slave->sdw_dev_lock);
        kfree(slave);
 }