soc: qcom: aoss: Fix missing put_device call in qmp_get
Subsystems (2)
PATCH 1/1 soc: qcom: aoss: Fix missing put_device call in qmp_get
The reference taken by 'of_find_device_by_node()' must be released when not needed anymore.
Add the corresponding 'put_device()' in the error handling paths.
Fixes 8c75d585b931 ("soc: qcom: aoss: Expose send for generic usecase")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/soc/qcom/qcom_aoss.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/soc/qcom/qcom_aoss.c +5 -1
@@ -451,7 +451,11 @@ struct qmp *qmp_get(struct device *dev) qmp =platform_get_drvdata (pdev); -return qmp ? qmp :ERR_PTR (-EPROBE_DEFER ); +if (!qmp) { +put_device (&pdev->dev); +return ERR_PTR (-EPROBE_DEFER ); + } +return qmp; }EXPORT_SYMBOL (qmp_get);
Signature · 1 line
2.17.1
Quoting Miaoqian Lin (2022-01-08 01:59:31)
Quoted 7 lines
The reference taken by '
of_find_device_by_node()' must be released when not needed anymore.
Add the corresponding 'put_device()' in the error handling paths.Fixes 8c75d585b931 ("soc: qcom: aoss: Expose send for generic usecase")Signed-off-by Miaoqian Lin <[email protected]>---
Reviewed-by Stephen Boyd <[email protected]>
Bjorn Andersson
AppliedRe: (subset) [PATCH] soc: qcom: aoss: Fix missing put_device call in qmp_get
In reply to Miaoqian LinQuoted 5 lines · Miaoqian Lin
The reference taken by '
of_find_device_by_node()' must be released when not needed anymore.
Add the corresponding 'put_device()' in the error handling paths.
Applied, thanks!
[1/1] soc: qcom: aoss: Fix missing put_device call in qmp_get
commit: 4b41a9d0fe3db5f91078a380f62f0572c3ecf2dd
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>