diff mbox series

[RESEND] rpmsg: glink: Release driver_override

Message ID 20230109223931.1706429-1-quic_bjorande@quicinc.com (mailing list archive)
State Accepted
Headers show
Series [RESEND] rpmsg: glink: Release driver_override | expand

Commit Message

Bjorn Andersson Jan. 9, 2023, 10:39 p.m. UTC
Upon termination of the rpmsg_device, driver_override needs to be freed
to avoid leaking the potentially assigned string.

Fixes: 42cd402b8fd4 ("rpmsg: Fix kfree() of static memory on setting driver_override")
Fixes: 39e47767ec9b ("rpmsg: Add driver_override device attribute for rpmsg_device")
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---

Resending this without the get_maintainer notes in the recipients list.

 drivers/rpmsg/qcom_glink_native.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bjorn Andersson Feb. 15, 2023, 7:21 p.m. UTC | #1
On Mon, 9 Jan 2023 14:39:31 -0800, Bjorn Andersson wrote:
> Upon termination of the rpmsg_device, driver_override needs to be freed
> to avoid leaking the potentially assigned string.
> 
> 

Applied, thanks!

[1/1] rpmsg: glink: Release driver_override
      commit: fb80ef67e8ff6a00d3faad4cb348dafdb8eccfd8

Best regards,
diff mbox series

Patch

diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 8620eea1dc8a..046271e439c5 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -1454,6 +1454,7 @@  static void qcom_glink_rpdev_release(struct device *dev)
 {
 	struct rpmsg_device *rpdev = to_rpmsg_device(dev);
 
+	kfree(rpdev->driver_override);
 	kfree(rpdev);
 }
 
@@ -1697,6 +1698,7 @@  static void qcom_glink_device_release(struct device *dev)
 
 	/* Release qcom_glink_alloc_channel() reference */
 	kref_put(&channel->refcount, qcom_glink_channel_release);
+	kfree(rpdev->driver_override);
 	kfree(rpdev);
 }