mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
landlock: Improve variable scope
This is now possible thanks to the disconnected directory fix. Cc: Günther Noack <gnoack@google.com> Cc: Song Liu <song@kernel.org> Cc: Tingmao Wang <m@maowtm.org> Link: https://lore.kernel.org/r/20251128172200.760753-3-mic@digikod.net Signed-off-by: Mickaël Salaün <mic@digikod.net>
This commit is contained in:
@@ -838,7 +838,6 @@ static bool is_access_to_paths_allowed(
|
||||
* restriction.
|
||||
*/
|
||||
while (true) {
|
||||
struct dentry *parent_dentry;
|
||||
const struct landlock_rule *rule;
|
||||
|
||||
/*
|
||||
@@ -931,7 +930,9 @@ jump_up:
|
||||
walker_path.dentry = walker_path.mnt->mnt_root;
|
||||
dget(walker_path.dentry);
|
||||
} else {
|
||||
parent_dentry = dget_parent(walker_path.dentry);
|
||||
struct dentry *const parent_dentry =
|
||||
dget_parent(walker_path.dentry);
|
||||
|
||||
dput(walker_path.dentry);
|
||||
walker_path.dentry = parent_dentry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user