]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 27 Oct 2025 06:06:01 +0000 (14:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2025 21:12:43 +0000 (06:12 +0900)
commitbcced25b4626021dae7ec474c18ba281ffd3607e
tree1377641a91cae165a4bb0a3b0f3a2a2cd93bf4e8
parent42f9bab7cf67e55bd757fe8cd3b7761f5b549447
slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves

commit 96cf8500934e0ce2a6c486f1dbc3b1fff12f7a5e upstream.

The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which
internally uses device_find_child() to obtain a device reference.
According to the device_find_child() documentation,
the caller must drop the reference with put_device() after use.

Found via static analysis and this is similar to commit 4e65bda8273c
("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")

Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20251027060601.33228-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/slimbus/qcom-ngd-ctrl.c