apparmor: lift new_profile declaration to remove C23 extension warning
the kernel test robot reports a C23 extension
warning: label followed by a declaration is a C23 extension
[-Wc23-extensions]
696 | struct aa_profile *new_profile = NULL;
Instead of adding a null statement creating a C99 style inline var
declaration lift the label declaration out of the block so that it no
longer immediatedly follows the label.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202411101808.AI8YG6cs-lkp@intel.com/
Fixes: ee650b3820f3 ("apparmor: properly handle cx/px lookup failure for complain")
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 04b5f0a5bfee5a5886dc19296c90d9a6964275e4)
Tested-by: Mustafa Bilgen <mbilgen@nvidia.com>
Reviewed-by: Mustafa Bilgen <mbilgen@nvidia.com>
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Ajay Nandakumar Mannargudi <anandakumarm@nvidia.com>
Signed-off-by: Vishwaroop A <va@nvidia.com>
Acked-by: Noah Wager <noah.wager@canonical.com>
Acked-by: Jacob Martin <jacob.martin@canonical.com>
Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
committed by
Noah Wager
parent
eb4d323dc6
commit
d78aaf41b1
@@ -642,6 +642,7 @@ static struct aa_label *profile_transition(const struct cred *subj_cred,
|
||||
struct aa_ruleset *rules = list_first_entry(&profile->rules,
|
||||
typeof(*rules), list);
|
||||
struct aa_label *new = NULL;
|
||||
struct aa_profile *new_profile = NULL;
|
||||
const char *info = NULL, *name = NULL, *target = NULL;
|
||||
aa_state_t state = rules->file->start[AA_CLASS_FILE];
|
||||
struct aa_perms perms = {};
|
||||
@@ -698,8 +699,6 @@ static struct aa_label *profile_transition(const struct cred *subj_cred,
|
||||
} else if (COMPLAIN_MODE(profile)) {
|
||||
create_learning_profile:
|
||||
/* no exec permission - learning mode */
|
||||
struct aa_profile *new_profile = NULL;
|
||||
|
||||
new_profile = aa_new_learning_profile(profile, false, name,
|
||||
GFP_KERNEL);
|
||||
if (!new_profile) {
|
||||
|
||||
Reference in New Issue
Block a user