Skip to content

Commit 96cf850

Browse files
Yuuoniygregkh
authored andcommitted
slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
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 4e65bda ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()") Fixes: 917809e ("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>
1 parent 1ebc180 commit 96cf850

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/slimbus/qcom-ngd-ctrl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,7 @@ static void qcom_slim_ngd_notify_slaves(struct qcom_slim_ngd_ctrl *ctrl)
12411241

12421242
if (slim_get_logical_addr(sbdev))
12431243
dev_err(ctrl->dev, "Failed to get logical address\n");
1244+
put_device(&sbdev->dev);
12441245
}
12451246
}
12461247

0 commit comments

Comments
 (0)