]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
landlock: Use scoped guards for ruleset in landlock_add_rule()
authorMickaël Salaün <mic@digikod.net>
Mon, 13 Jan 2025 16:11:10 +0000 (17:11 +0100)
committerMickaël Salaün <mic@digikod.net>
Tue, 14 Jan 2025 10:57:45 +0000 (11:57 +0100)
commit16a6f4d3b558bd55b52892f2becad8f33cb62ed2
tree447f0e347c1ee14043774983204f5559dc29fb97
parentd32f79a59ae1a90f27735c75f9920c585e6ceb8f
landlock: Use scoped guards for ruleset in landlock_add_rule()

Simplify error handling by replacing goto statements with automatic
calls to landlock_put_ruleset() when going out of scope.

This change depends on the TCP support.

Cc: Konstantin Meskhidze <konstantin.meskhidze@huawei.com>
Cc: Mikhail Ivanov <ivanov.mikhail1@huawei-partners.com>
Reviewed-by: Günther Noack <gnoack@google.com>
Link: https://lore.kernel.org/r/20250113161112.452505-3-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
security/landlock/syscalls.c