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>
This commit is contained in:
Pasha Tatashin 2026-06-03 15:43:51 +00:00 committed by Mike Rapoport (Microsoft)
parent 81fbb909ec
commit 6af06e11bd

View File

@ -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)