Commit fb80ef67 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Bjorn Andersson

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: 42cd402b ("rpmsg: Fix kfree() of static memory on setting driver_override")
Fixes: 39e47767 ("rpmsg: Add driver_override device attribute for rpmsg_device")
Reviewed-by: default avatarChris Lew <quic_clew@quicinc.com>
Signed-off-by: default avatarBjorn Andersson <quic_bjorande@quicinc.com>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230109223931.1706429-1-quic_bjorande@quicinc.com
parent 3e74ec2f
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment