]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: Fix clang build error in __xp_alloc
authorMagnus Karlsson <magnus.karlsson@intel.com>
Wed, 29 Sep 2021 06:14:03 +0000 (08:14 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 29 Sep 2021 11:59:13 +0000 (13:59 +0200)
commit80ec39d22b4bd638328441fd6f5b20ef4f620ec3
treeb5eed397003f8df2b1def39c22c2d36e3ef01b20
parent0256a587dafd11571167758929e211dace76efce
xsk: Fix clang build error in __xp_alloc

Fix a build error with clang in __xp_alloc():

  [...]
  net/xdp/xsk_buff_pool.c:465:15: error: variable 'xskb' is uninitialized
  when used here [-Werror,-Wuninitialized]
                          xp_release(xskb);
                                     ^~~~

This is correctly detected by clang, but not gcc. In fact, the xp_release()
statement should not be there at all in the refactored code, just remove it.

Fixes: be9a4c678e3b ("xsk: Optimize for aligned case")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20210929061403.8587-1-magnus.karlsson@gmail.com
net/xdp/xsk_buff_pool.c