]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
apparmor: remove unnecessary goto and associated label
authorJohn Johansen <john.johansen@canonical.com>
Wed, 6 May 2026 08:17:38 +0000 (01:17 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Sun, 14 Jun 2026 03:18:17 +0000 (20:18 -0700)
There is no need for a goto a label immediately following the
conditional block when the jump is the last statement in the block.

Fixes: 7306c41672487 ("apparmor: release exe file resources on path failure")
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/task.c

index 6445cb5f85266873ca54c7fc0ca5e64394fdaf2a..b9fb3738124e05473ba04c298b9b2aa4f13745ce 100644 (file)
@@ -313,12 +313,9 @@ static const char *get_current_exe_path(char *buffer, int buffer_size)
        p = exe_file->f_path;
        path_get(&p);
 
-       if (aa_path_name(&p, FLAG_VIEW_SUBNS, buffer, &path_str, NULL, NULL)) {
+       if (aa_path_name(&p, FLAG_VIEW_SUBNS, buffer, &path_str, NULL, NULL))
                path_str = ERR_PTR(-ENOMEM);
-               goto out;
-       }
 
-out:
        fput(exe_file);
        path_put(&p);