]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
landlock: Use mem_is_zero() in is_layer_masks_allowed()
authorGünther Noack <gnoack3000@gmail.com>
Fri, 27 Mar 2026 16:48:27 +0000 (17:48 +0100)
committerMickaël Salaün <mic@digikod.net>
Tue, 7 Apr 2026 16:51:06 +0000 (18:51 +0200)
This is equivalent, but expresses the intent a bit clearer.

Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Link: https://lore.kernel.org/r/20260327164838.38231-3-gnoack3000@gmail.com
Signed-off-by: Mickaël Salaün <mic@digikod.net>
security/landlock/fs.c

index a03ec664c78e9be461426e612c4b32bd94a90aa3..97065d51685a916a6bd39466ad87b9dfbafb1242 100644 (file)
@@ -564,7 +564,7 @@ static void test_no_more_access(struct kunit *const test)
 
 static bool is_layer_masks_allowed(const struct layer_access_masks *masks)
 {
-       return !memchr_inv(&masks->access, 0, sizeof(masks->access));
+       return mem_is_zero(&masks->access, sizeof(masks->access));
 }
 
 /*