]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
apparmor: cleanup remove unused percpu critical sections in buffer management
authorJohn Johansen <john.johansen@canonical.com>
Wed, 21 Jan 2026 09:09:11 +0000 (01:09 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Thu, 29 Jan 2026 09:27:55 +0000 (01:27 -0800)
There are two unused percpu critical sections in the buffer management
code. These are remanents from when a more complex hold algorithm was
used. Remove them, as they serve no purpose.

Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/lsm.c

index 34fc458887d7cdac2796677f81b0dfbc26056c51..dcd066e04d2b18fcc2de0f3cc43e369d48e11238 100644 (file)
@@ -2174,9 +2174,6 @@ char *aa_get_buffer(bool in_atomic)
                cache_hold_inc(&cache->hold);
                put_cpu_ptr(&aa_local_buffers);
                spin_lock(&aa_buffers_lock);
-       } else {
-               cache = get_cpu_ptr(&aa_local_buffers);
-               put_cpu_ptr(&aa_local_buffers);
        }
 retry:
        if (buffer_count > reserve_count ||
@@ -2231,8 +2228,6 @@ void aa_put_buffer(char *buf)
                        list_add(&aa_buf->list, &aa_global_buffers);
                        buffer_count++;
                        spin_unlock(&aa_buffers_lock);
-                       cache = get_cpu_ptr(&aa_local_buffers);
-                       put_cpu_ptr(&aa_local_buffers);
                        return;
                }
                /* contention on global list, fallback to percpu */