aboutsummaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2023-06-19 11:12:10 +0200
committerJakub Kicinski <kuba@kernel.org>2023-06-20 20:37:16 -0700
commitf61d2d5cf142436cd1a02ddc78425e91116b8b0d (patch)
tree2e30ef44257e23410f2394a276fd0b013131045f /net/unix/af_unix.c
parent40cba83370c2c97fd970cb0e273e76f99f0f2db6 (diff)
downloadlinux-f61d2d5cf142436cd1a02ddc78425e91116b8b0d.tar.gz
linux-f61d2d5cf142436cd1a02ddc78425e91116b8b0d.tar.bz2
linux-f61d2d5cf142436cd1a02ddc78425e91116b8b0d.zip
sfc: fix uninitialized variable use
The new efx_bind_neigh() function contains a broken code path when IPV6 is disabled: drivers/net/ethernet/sfc/tc_encap_actions.c:144:7: error: variable 'n' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (encap->type & EFX_ENCAP_FLAG_IPV6) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sfc/tc_encap_actions.c:184:8: note: uninitialized use occurs here if (!n) { ^ drivers/net/ethernet/sfc/tc_encap_actions.c:144:3: note: remove the 'if' if its condition is always false if (encap->type & EFX_ENCAP_FLAG_IPV6) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sfc/tc_encap_actions.c:141:22: note: initialize the variable 'n' to silence this warning struct neighbour *n; ^ = NULL Change it to use the existing error handling path here. Fixes: 7e5e7d800011a ("sfc: neighbour lookup for TC encap action offload") Suggested-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Edward Cree <ecree.xilinx@gmail.com> Link: https://lore.kernel.org/r/20230619091215.2731541-2-arnd@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions