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.

pidfs: avoid misleading break

The break would only break out of the scoped_guard() loop, not the
switch statement. It still works correct as is ofc but let's avoid the
confusion.

Reported-by: David Lechner <dlechner@baylibre.com>
Link:: https://lore.kernel.org/cd2153f1-098b-463c-bbc1-5c6ca9ef1f12@baylibre.com
Signed-off-by: Christian Brauner <brauner@kernel.org>

+4 -6
+4 -6
fs/pidfs.c
··· 577 577 struct user_namespace *user_ns; 578 578 579 579 user_ns = task_cred_xxx(task, user_ns); 580 - if (!ns_ref_get(user_ns)) 581 - break; 582 - ns_common = to_ns_common(user_ns); 580 + if (ns_ref_get(user_ns)) 581 + ns_common = to_ns_common(user_ns); 583 582 } 584 583 #endif 585 584 break; ··· 588 589 struct pid_namespace *pid_ns; 589 590 590 591 pid_ns = task_active_pid_ns(task); 591 - if (!ns_ref_get(pid_ns)) 592 - break; 593 - ns_common = to_ns_common(pid_ns); 592 + if (ns_ref_get(pid_ns)) 593 + ns_common = to_ns_common(pid_ns); 594 594 } 595 595 #endif 596 596 break;