From: Günther Noack Date: Fri, 27 Mar 2026 16:48:27 +0000 (+0100) Subject: landlock: Use mem_is_zero() in is_layer_masks_allowed() X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=1c4fe87364782d1b058cc9d15fc8acef44bce033;p=thirdparty%2Fkernel%2Flinux.git landlock: Use mem_is_zero() in is_layer_masks_allowed() This is equivalent, but expresses the intent a bit clearer. Signed-off-by: Günther Noack Link: https://lore.kernel.org/r/20260327164838.38231-3-gnoack3000@gmail.com Signed-off-by: Mickaël Salaün --- diff --git a/security/landlock/fs.c b/security/landlock/fs.c index a03ec664c78e9..97065d51685a9 100644 --- a/security/landlock/fs.c +++ b/security/landlock/fs.c @@ -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)); } /*