From: "Clément Le Goffic" <clement.legoffic@foss.st.com>
To: "Clément Léger" <clement.leger@bootlin.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Jens Wiklander" <jens.wiklander@linaro.org>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
"Clément Le Goffic" <clement.legoffic@foss.st.com>,
linux-stm32@st-md-mailman.stormreply.com
Subject: [PATCH 1/3] rtc: rtc-optee: fix memory leak on driver removal
Date: Tue, 15 Jul 2025 16:07:13 +0200 [thread overview]
Message-ID: <20250715-upstream-optee-rtc-v1-1-e0fdf8aae545@foss.st.com> (raw)
In-Reply-To: <20250715-upstream-optee-rtc-v1-0-e0fdf8aae545@foss.st.com>
Fix a memory leak in case of driver removal.
Free the shared memory used for arguments exchanges between kernel and
OP-TEE RTC PTA.
Fixes: 81c2f059ab90 ("rtc: optee: add RTC driver for OP-TEE RTC PTA")
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
---
drivers/rtc/rtc-optee.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/rtc/rtc-optee.c b/drivers/rtc/rtc-optee.c
index 9f8b5d4a8f6b..6b77c122fdc1 100644
--- a/drivers/rtc/rtc-optee.c
+++ b/drivers/rtc/rtc-optee.c
@@ -320,6 +320,7 @@ static int optee_rtc_remove(struct device *dev)
{
struct optee_rtc *priv = dev_get_drvdata(dev);
+ tee_shm_free(priv->shm);
tee_client_close_session(priv->ctx, priv->session_id);
tee_client_close_context(priv->ctx);
--
2.43.0
next prev parent reply other threads:[~2025-07-15 14:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 14:07 [PATCH 0/3] Add alarm operation to the rtc-optee driver Clément Le Goffic
2025-07-15 14:07 ` Clément Le Goffic [this message]
2025-07-15 14:07 ` [PATCH 2/3] rtc: optee: remove unnecessary memory operations Clément Le Goffic
2025-07-15 14:07 ` [PATCH 3/3] rtc: optee: add alarm related rtc ops to optee rtc driver Clément Le Goffic
2025-09-11 12:56 ` [PATCH 0/3] Add alarm operation to the rtc-optee driver Clément Le Goffic
2025-09-11 13:02 ` Clément Le Goffic
2025-09-14 23:18 ` Alexandre Belloni
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=20250715-upstream-optee-rtc-v1-1-e0fdf8aae545@foss.st.com \
--to=clement.legoffic@foss.st.com \
--cc=alexandre.belloni@bootlin.com \
--cc=clement.leger@bootlin.com \
--cc=jens.wiklander@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
/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
all inboxes | Powered by JetHome®