mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
landlock: Fix formatting
[ Upstream commit405ca72dc5] Auto-format with clang-format -i security/landlock/*.[ch] Cc: Günther Noack <gnoack@google.com> Cc: Kees Cook <kees@kernel.org> Fixes:69050f8d6d("treewide: Replace kmalloc with kmalloc_obj for non-scalar types") Reviewed-by: Günther Noack <gnoack3000@gmail.com> Link: https://lore.kernel.org/r/20260303173632.88040-1-mic@digikod.net Signed-off-by: Mickaël Salaün <mic@digikod.net> Stable-dep-of:b232bd1278("landlock: Account all audit data allocations to user space") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
682a0066dd
commit
a95b62759f
@@ -94,8 +94,7 @@ static struct landlock_details *get_current_details(void)
|
||||
* allocate with GFP_KERNEL_ACCOUNT because it is independent from the
|
||||
* caller.
|
||||
*/
|
||||
details =
|
||||
kzalloc(struct_size(details, exe_path, path_size), GFP_KERNEL);
|
||||
details = kzalloc_flex(*details, exe_path, path_size);
|
||||
if (!details)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
@@ -33,9 +33,8 @@ static struct landlock_ruleset *create_ruleset(const u32 num_layers)
|
||||
{
|
||||
struct landlock_ruleset *new_ruleset;
|
||||
|
||||
new_ruleset =
|
||||
kzalloc(struct_size(new_ruleset, access_masks, num_layers),
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
new_ruleset = kzalloc_flex(*new_ruleset, access_masks, num_layers,
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
if (!new_ruleset)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
refcount_set(&new_ruleset->usage, 1);
|
||||
@@ -553,7 +552,7 @@ landlock_merge_ruleset(struct landlock_ruleset *const parent,
|
||||
return new_dom;
|
||||
|
||||
new_dom->hierarchy =
|
||||
kzalloc(sizeof(*new_dom->hierarchy), GFP_KERNEL_ACCOUNT);
|
||||
kzalloc_obj(*new_dom->hierarchy, GFP_KERNEL_ACCOUNT);
|
||||
if (!new_dom->hierarchy)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user