summaryrefslogtreecommitdiff
path: root/security/apparmor
diff options
context:
space:
mode:
authorMateusz Guzik <mjguzik@gmail.com>2025-01-27 21:54:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 16:28:28 +0200
commitf8c001884bb4da56ce5617ed6c747ae61a17878f (patch)
tree5493623508496c2f0f3fb1a51b07880baeec5b25 /security/apparmor
parentdd45d42ab290f2157452320f6ce51bbf3ed17295 (diff)
downloadlinux-f8c001884bb4da56ce5617ed6c747ae61a17878f.tar.gz
linux-f8c001884bb4da56ce5617ed6c747ae61a17878f.tar.bz2
linux-f8c001884bb4da56ce5617ed6c747ae61a17878f.zip
apparmor: use the condition in AA_BUG_FMT even with debug disabled
[ Upstream commit 67e370aa7f968f6a4f3573ed61a77b36d1b26475 ] This follows the established practice and fixes a build failure for me: security/apparmor/file.c: In function ‘__file_sock_perm’: security/apparmor/file.c:544:24: error: unused variable ‘sock’ [-Werror=unused-variable] 544 | struct socket *sock = (struct socket *) file->private_data; | ^~~~ Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security/apparmor')
-rw-r--r--security/apparmor/include/lib.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/security/apparmor/include/lib.h b/security/apparmor/include/lib.h
index 73c8a32c6861..6e88e99da80f 100644
--- a/security/apparmor/include/lib.h
+++ b/security/apparmor/include/lib.h
@@ -46,7 +46,11 @@
#define AA_BUG_FMT(X, fmt, args...) \
WARN((X), "AppArmor WARN %s: (" #X "): " fmt, __func__, ##args)
#else
-#define AA_BUG_FMT(X, fmt, args...) no_printk(fmt, ##args)
+#define AA_BUG_FMT(X, fmt, args...) \
+ do { \
+ BUILD_BUG_ON_INVALID(X); \
+ no_printk(fmt, ##args); \
+ } while (0)
#endif
#define AA_ERROR(fmt, args...) \