Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf: Make RB allocation branch self sufficient

Ensure @rb usage doesn't extend out of the branch block.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Link: https://lore.kernel.org/r/20250812104019.605285302@infradead.org

+1 -5
+1 -5
kernel/events/core.c
··· 7116 7116 * multiple times. 7117 7117 */ 7118 7118 ret = 0; 7119 - /* We need the rb to map pages. */ 7120 - rb = event->rb; 7121 7119 perf_mmap_account(vma, user_extra, extra); 7122 7120 atomic_inc(&event->mmap_count); 7123 7121 goto unlock; ··· 7133 7135 ret = -EPERM; 7134 7136 goto unlock; 7135 7137 } 7136 - 7137 - WARN_ON(!rb && event->rb); 7138 7138 7139 7139 if (vma->vm_flags & VM_WRITE) 7140 7140 flags |= RING_BUFFER_WRITABLE; ··· 7186 7190 * full cleanup in this case and therefore does not invoke 7187 7191 * vmops::close(). 7188 7192 */ 7189 - ret = map_range(rb, vma); 7193 + ret = map_range(event->rb, vma); 7190 7194 if (ret) 7191 7195 perf_mmap_close(vma); 7192 7196