diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-03-25 15:23:11 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-31 06:46:31 -0700 |
commit | a2ace9b243878ab2c3392a08df47faaca1edaf14 (patch) | |
tree | cacb18f3ad3ddec957c0ddb93c8b99a052ee1b59 /tools/bpf | |
parent | c7595096daf9c0b5b5833e0f3ad4fc87ee29c45b (diff) | |
download | linux-rpi3-a2ace9b243878ab2c3392a08df47faaca1edaf14.tar.gz linux-rpi3-a2ace9b243878ab2c3392a08df47faaca1edaf14.tar.bz2 linux-rpi3-a2ace9b243878ab2c3392a08df47faaca1edaf14.zip |
selinux: avoid uninitialized variable warning
[ Upstream commit 98bbbb76f2edcfb8fb2b8f4b3ccc7b6e99d64bd8 ]
clang correctly points out a code path that would lead
to an uninitialized variable use:
security/selinux/netlabel.c:310:6: error: variable 'addr' is used uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
if (ip_hdr(skb)->version == 4) {
^~~~~~~~~~~~~~~~~~~~~~~~~
security/selinux/netlabel.c:322:40: note: uninitialized use occurs here
rc = netlbl_conn_setattr(ep->base.sk, addr, &secattr);
^~~~
security/selinux/netlabel.c:310:2: note: remove the 'if' if its condition is always true
if (ip_hdr(skb)->version == 4) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
security/selinux/netlabel.c:291:23: note: initialize the variable 'addr' to silence this warning
struct sockaddr *addr;
^
= NULL
This is probably harmless since we should not see ipv6 packets
of CONFIG_IPV6 is disabled, but it's better to rearrange the code
so this cannot happen.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[PM: removed old patchwork link, fixed checkpatch.pl style errors]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/bpf')
0 files changed, 0 insertions, 0 deletions