rpmsg: qcom_smd: release channel OF node on device destruction
Subsystems (2)
PATCH 1/1 rpmsg: qcom_smd: release channel OF node on device destruction
qcom_smd_match_channel() returns a referenced OF child node, which is stored in rpdev->dev.of_node. qcom_smd_release_device() frees the device without dropping that reference, leaking it when the channel device is released.
Release the OF node reference in the device release callback.
Fixes 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
Signed-off-by Avi Weiss <[email protected]>
--- drivers/rpmsg/qcom_smd.c | 1 + 1 file changed, 1 insertion(+)
drivers/rpmsg/qcom_smd.c +1 -0
@@ -1065,6 +1065,7 @@ static void qcom_smd_release_device(struct device *dev)struct rpmsg_device *rpdev =to_rpmsg_device (dev);struct qcom_smd_device *qsdev =to_smd_device (rpdev); +of_node_put (dev->of_node);kfree (qsdev); }
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
Signature · 1 line
2.43.0
Quoted 10 lines · Avi Weiss
qcom_smd_match_channel()returns a referenced OF child node, which is stored inrpdev->dev.of_node.qcom_smd_release_device()frees the device without dropping that reference, leaking it when the channel device is released.Release the OF node reference in the device release callback.
Fixes 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")Signed-off-by Avi Weiss <[email protected]>---
Acked-by Konrad Dybcio <[email protected]>
Konrad