summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPasha Tatashin <pasha.tatashin@soleen.com>2026-06-03 15:43:51 +0000
committerMike Rapoport (Microsoft) <rppt@kernel.org>2026-06-03 21:15:45 +0300
commit6af06e11bd48bdefaf9381f6ff0bd65b1e5d98ab (patch)
treedfec87bde102c8c549ab0de86750135959f4b2bb /kernel
parent81fbb909ec07868415f6b2269922c8d1cc6a215a (diff)
downloadlinux-6af06e11bd48bdefaf9381f6ff0bd65b1e5d98ab.tar.gz
linux-6af06e11bd48bdefaf9381f6ff0bd65b1e5d98ab.zip
liveupdate: avoid mixing cleanup guards with goto in luo_session_retrieve_fd
Refactoring luo_session_retrieve_fd() to avoid mixing automated cleanup-style guards with goto-based resource release, which is not recommended under the Linux kernel coding style. Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com> Link: https://patch.msgid.link/20260603154402.468928-3-pasha.tatashin@soleen.com Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/liveupdate/luo_session.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_session.c
index 5c6cebc6e326..47566db64598 100644
--- a/kernel/liveupdate/luo_session.c
+++ b/kernel/liveupdate/luo_session.c
@@ -291,10 +291,11 @@ static int luo_session_retrieve_fd(struct luo_session *session,
if (argp->fd < 0)
return argp->fd;
- guard(mutex)(&session->mutex);
+ mutex_lock(&session->mutex);
err = luo_retrieve_file(&session->file_set, argp->token, &file);
+ mutex_unlock(&session->mutex);
if (err < 0)
- goto err_put_fd;
+ goto err_put_fd;
err = luo_ucmd_respond(ucmd, sizeof(*argp));
if (err)