summaryrefslogtreecommitdiff
path: root/drivers/rpmsg
diff options
context:
space:
mode:
authorBjorn Andersson <quic_bjorande@quicinc.com>2023-01-09 14:39:31 -0800
committerBjorn Andersson <andersson@kernel.org>2023-02-15 07:46:02 -0800
commitfb80ef67e8ff6a00d3faad4cb348dafdb8eccfd8 (patch)
treea86687413ef88e4c2486688baa90e9d7347f3529 /drivers/rpmsg
parent3e74ec2f39362bffbd42854acbb67c7f4cb808f9 (diff)
rpmsg: glink: Release driver_override
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") Reviewed-by: Chris Lew <quic_clew@quicinc.com> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230109223931.1706429-1-quic_bjorande@quicinc.com
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r--drivers/rpmsg/qcom_glink_native.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index b6c60bf86009..01d2805fe30f 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -1455,6 +1455,7 @@ static void qcom_glink_rpdev_release(struct device *dev)
{
struct rpmsg_device *rpdev = to_rpmsg_device(dev);
+ kfree(rpdev->driver_override);
kfree(rpdev);
}
@@ -1698,6 +1699,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);
}