Skip to content

Commit 04b5f0a

Browse files
committed
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: ee650b3 ("apparmor: properly handle cx/px lookup failure for complain") Signed-off-by: John Johansen <[email protected]>
1 parent 8acf7ad commit 04b5f0a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

security/apparmor/domain.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ static struct aa_label *profile_transition(const struct cred *subj_cred,
636636
struct aa_ruleset *rules = list_first_entry(&profile->rules,
637637
typeof(*rules), list);
638638
struct aa_label *new = NULL;
639+
struct aa_profile *new_profile = NULL;
639640
const char *info = NULL, *name = NULL, *target = NULL;
640641
aa_state_t state = rules->file->start[AA_CLASS_FILE];
641642
struct aa_perms perms = {};
@@ -692,8 +693,6 @@ static struct aa_label *profile_transition(const struct cred *subj_cred,
692693
} else if (COMPLAIN_MODE(profile)) {
693694
create_learning_profile:
694695
/* no exec permission - learning mode */
695-
struct aa_profile *new_profile = NULL;
696-
697696
new_profile = aa_new_learning_profile(profile, false, name,
698697
GFP_KERNEL);
699698
if (!new_profile) {

0 commit comments

Comments
 (0)