From: Lee Jones <lee@kernel.org>
To: lee@kernel.org
Cc: stable@vger.kernel.org,
Bjorn Andersson <quic_bjorande@quicinc.com>,
Chris Lew <quic_clew@quicinc.com>,
Bjorn Andersson <andersson@kernel.org>
Subject: [PATCH v5.10.y 5/6] rpmsg: glink: Release driver_override
Date: Tue, 31 Oct 2023 09:23:00 +0000 [thread overview]
Message-ID: <20231031092308.2227611-5-lee@kernel.org> (raw)
In-Reply-To: <20231031092308.2227611-1-lee@kernel.org>
From: Bjorn Andersson <quic_bjorande@quicinc.com>
commit fb80ef67e8ff6a00d3faad4cb348dafdb8eccfd8 upstream.
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
Signed-off-by: Lee Jones <lee@kernel.org>
Change-Id: Ifb8f7c7875d1126860a5a38fb5b9e2388bf1511d
---
drivers/rpmsg/qcom_glink_native.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index e776d1bfc9767..28b6ae0e1a2fd 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -1379,6 +1379,7 @@ static void qcom_glink_rpdev_release(struct device *dev)
struct glink_channel *channel = to_glink_channel(rpdev->ept);
channel->rpdev = NULL;
+ kfree(rpdev->driver_override);
kfree(rpdev);
}
@@ -1607,6 +1608,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);
}
--
2.42.0.820.g83a721a137-goog
next prev parent reply other threads:[~2023-10-31 9:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 9:22 [PATCH v5.10.y 1/6] driver: platform: Add helper for safer setting of driver_override Lee Jones
2023-10-31 9:22 ` [PATCH v5.10.y 2/6] rpmsg: Constify local variable in field store macro Lee Jones
2023-10-31 9:22 ` [PATCH v5.10.y 3/6] rpmsg: Fix kfree() of static memory on setting driver_override Lee Jones
2023-10-31 9:22 ` [PATCH v5.10.y 4/6] rpmsg: Fix calling device_lock() on non-initialized device Lee Jones
2023-10-31 9:23 ` Lee Jones [this message]
2023-10-31 9:23 ` [PATCH v5.10.y 6/6] rpmsg: Fix possible refcount leak in rpmsg_register_device_override() Lee Jones
2023-10-31 9:37 ` [PATCH v5.10.y 1/6] driver: platform: Add helper for safer setting of driver_override Lee Jones
-- strict thread matches above, loose matches on Subject: below --
2023-10-31 11:33 Lee Jones
2023-10-31 11:33 ` [PATCH v5.10.y 5/6] rpmsg: glink: Release driver_override Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231031092308.2227611-5-lee@kernel.org \
--to=lee@kernel.org \
--cc=andersson@kernel.org \
--cc=quic_bjorande@quicinc.com \
--cc=quic_clew@quicinc.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox