Skip to contentSkip to conversation

security/apparmor/label.c:1406:20: warning: unused variable 'tmp'

PATCH kernel test robot 1 participant 1 message Feb 2

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor.git apparmor-next
head:   173a18bf6c87bb337d2fe8d59b5a41b3cfa38fda
commit: a4c9efa4dbad6dacad6e8b274e30e814c8353097 [23/29] apparmor: make label_match return a consistent value
config: x86_64-rhel-9.4-kunit (https://download.01.org/0day-ci/archive/20260202/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260202/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

security/apparmor/label.c: In function 'aa_label_match':

>> security/apparmor/label.c:1406:20: warning: unused variable 'tmp' [-Wunused-variable]

1406 | aa_state_t tmp = label_compound_match(profile, rules, label, state, subns,
| ^~~

vim +/tmp +1406 security/apparmor/label.c

1389
1390 /**
1391 * aa_label_match - do a multi-component label match
1392 * @profile: profile to match against (NOT NULL)
1393 * @rules: ruleset to search
1394 * @label: label to match (NOT NULL)
1395 * @state: state to start in
1396 * @subns: whether to match subns components
1397 * @request: permission request
1398 * @perms: Returns computed perms (NOT NULL)
1399 *
1400 * Returns: the state the match finished in, may be the none matching state
1401 */
1402 int aa_label_match(struct aa_profile *profile, struct aa_ruleset *rules,
1403 struct aa_label *label, aa_state_t state, bool subns,
1404 u32 request, struct aa_perms *perms)
1405 {

> 1406		aa_state_t tmp = label_compound_match(profile, rules, label, state, subns,

1407 request, perms);
1408 if ((perms->allow & request) == request)
1409 return 0;
1410
1411 /* failed compound_match try component matches */
1412 *perms = allperms;
1413 return label_components_match(profile, rules, label, state, subns,
1414 request, perms);
1415 }
1416

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki