From: Joe Hattori Date: Thu, 5 Dec 2024 03:48:44 +0000 (+0900) Subject: soundwire: slave: fix an OF node reference leak in soundwire slave device X-Git-Tag: v6.15-rc1~77^2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aac2f8363f773ae1f65aab140e06e2084ac6b787;p=thirdparty%2Fkernel%2Flinux.git 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: a2e484585ad3 ("soundwire: core: add device tree support for slave devices") Signed-off-by: Joe Hattori Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20241205034844.2784964-1-joe@pf.is.s.u-tokyo.ac.jp Signed-off-by: Vinod Koul --- diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c index 4869b073b11c2..d2d99555ec5a5 100644 --- a/drivers/soundwire/slave.c +++ b/drivers/soundwire/slave.c @@ -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); }