slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
Subsystems (4)
PATCH 1/1 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 4e65bda8273c ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")
--- drivers/slimbus/qcom-ngd-ctrl.c | 1 + 1 file changed, 1 insertion(+)
drivers/slimbus/qcom-ngd-ctrl.c +1 -0
@@ -1241,6 +1241,7 @@ static void qcom_slim_ngd_notify_slaves(struct qcom_slim_ngd_ctrl *ctrl)if (slim_get_logical_addr (sbdev))dev_err (ctrl->dev,"Failed to get logical address\n" ); +put_device (&sbdev->dev); } }
Signature · 1 line
2.39.5 (Apple Git-154)
Quoted 8 lines · Miaoqian Lin
The function
qcom_slim_ngd_notify_slaves()callsof_slim_get_device()which internally usesdevice_find_child()to obtain a device reference. According to thedevice_find_child()documentation,
the caller must drop the reference withput_device()after use.Found via static analysis and this is similar to commit
4e65bda8273c("ASoC: wcd934x: fix error handling inwcd934x_codec_parse_data()")
Quoted 7 lines
Fixes 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")Signed-off-by Miaoqian Lin <[email protected]>--- drivers/slimbus/qcom-ngd-ctrl.c | 1 + 1 file changed, 1 insertion(+)
Signature · 2 lines
With best wishes Dmitry
Quoted 9 lines · Miaoqian Lin
The function
qcom_slim_ngd_notify_slaves()callsof_slim_get_device()which internally usesdevice_find_child()to obtain a device reference. According to thedevice_find_child()documentation,
the caller must drop the reference withput_device()after use.Found via static analysis and this is similar to commit
4e65bda8273c("ASoC: wcd934x: fix error handling inwcd934x_codec_parse_data()")[...]
Applied, thanks!
[1/1] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
commit: 79d84af332094852614b15638f7ffe18f5f7966e
Best regards,
Signature · 1 line
Srinivas Kandagatla <[email protected]>
Vinod Koul
AppliedQuoted 9 lines · Miaoqian Lin
The function
qcom_slim_ngd_notify_slaves()callsof_slim_get_device()which internally usesdevice_find_child()to obtain a device reference. According to thedevice_find_child()documentation,
the caller must drop the reference withput_device()after use.Found via static analysis and this is similar to commit
4e65bda8273c("ASoC: wcd934x: fix error handling inwcd934x_codec_parse_data()")[...]
Applied, thanks!
[1/1] slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
commit: bcd8db9640bcad313f7fbf8433fcb5459cdd760a
Best regards,
Signature · 1 line
~Vinod
Quoted 7 lines · Vinod Koul
Quoted 5 lines · Miaoqian Lin
The function
qcom_slim_ngd_notify_slaves()callsof_slim_get_device()which internally usesdevice_find_child()to obtain a device reference. According to thedevice_find_child()documentation,
the caller must drop the reference withput_device()after use.
Quoted 6 lines
Quoted 4 lines
Found via static analysis and this is similar to commit
4e65bda8273c("ASoC: wcd934x: fix error handling inwcd934x_codec_parse_data()")[...]
Applied, thanks!
These are slimbus patches? any reason why they are going via soundwire tree?
--srini>
Quoted 4 lines
[1/1] slimbus: ngd: Fix reference count leak in
qcom_slim_ngd_notify_slavescommit: bcd8db9640bcad313f7fbf8433fcb5459cdd760aBest regards,
Quoted 10 lines · Srinivas Kandagatla
Quoted 7 lines · Vinod Koul
Quoted 5 lines · Miaoqian Lin
The function
qcom_slim_ngd_notify_slaves()callsof_slim_get_device()which internally usesdevice_find_child()to obtain a device reference. According to thedevice_find_child()documentation,
the caller must drop the reference withput_device()after use.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Found via static analysis and this is similar to commit
4e65bda8273c("ASoC: wcd934x: fix error handling inwcd934x_codec_parse_data()")[...]
Applied, thanks!
These are slimbus patches? any reason why they are going via soundwire tree?
My mistake, sorry :-( dropped now
Signature · 1 line
~Vinod