]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
liveupdate: avoid mixing cleanup guards with goto in luo_session_retrieve_fd
authorPasha Tatashin <pasha.tatashin@soleen.com>
Wed, 3 Jun 2026 15:43:51 +0000 (15:43 +0000)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Wed, 3 Jun 2026 18:15:45 +0000 (21:15 +0300)
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>
kernel/liveupdate/luo_session.c

index 5c6cebc6e32661aba14adaa492be82bd18059ee4..47566db64598d9b09909ea226cff54f662e0c740 100644 (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)