]> 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:24:59 +0000 (06:24 +0900)
commit0904f0400e93c57cfd07776fa870d8e03299d64e
treef77b8fb0825960c7fb7a520a30cc5c44cea9df68
parent1a96b5f823a3435a2e77bce7258b46cb2e76a937
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