Skip to content

Commit 859b725

Browse files
committed
apparmor: cleanup remove unused percpu critical sections in buffer management
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>
1 parent 0b6a6b7 commit 859b725

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

security/apparmor/lsm.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,9 +2174,6 @@ char *aa_get_buffer(bool in_atomic)
21742174
cache_hold_inc(&cache->hold);
21752175
put_cpu_ptr(&aa_local_buffers);
21762176
spin_lock(&aa_buffers_lock);
2177-
} else {
2178-
cache = get_cpu_ptr(&aa_local_buffers);
2179-
put_cpu_ptr(&aa_local_buffers);
21802177
}
21812178
retry:
21822179
if (buffer_count > reserve_count ||
@@ -2231,8 +2228,6 @@ void aa_put_buffer(char *buf)
22312228
list_add(&aa_buf->list, &aa_global_buffers);
22322229
buffer_count++;
22332230
spin_unlock(&aa_buffers_lock);
2234-
cache = get_cpu_ptr(&aa_local_buffers);
2235-
put_cpu_ptr(&aa_local_buffers);
22362231
return;
22372232
}
22382233
/* contention on global list, fallback to percpu */

0 commit comments

Comments
 (0)