Commit 67e370aa authored by Mateusz Guzik's avatar Mateusz Guzik Committed by John Johansen
Browse files

apparmor: use the condition in AA_BUG_FMT even with debug disabled



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: default avatarMateusz Guzik <mjguzik@gmail.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent aabbe6f9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -60,7 +60,11 @@ do { \
#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

int aa_parse_debug_params(const char *str);