Commit 3e45553a authored by Nathan Chancellor's avatar Nathan Chancellor Committed by John Johansen
Browse files

apparmor: Remove unused variable 'sock' in __file_sock_perm()



When CONFIG_SECURITY_APPARMOR_DEBUG_ASSERTS is disabled, there is a
warning that sock is unused:

  security/apparmor/file.c: In function '__file_sock_perm':
  security/apparmor/file.c:544:24: warning: unused variable 'sock' [-Wunused-variable]
    544 |         struct socket *sock = (struct socket *) file->private_data;
        |                        ^~~~

sock was moved into aa_sock_file_perm(), where the same check is
present, so remove sock and the assertion from __file_sock_perm() to fix
the warning.

Fixes: c05e7058 ("apparmor: add fine grained af_unix mediation")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501190757.myuLxLyL-lkp@intel.com/


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent 67e370aa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment