xsk: fix clang build error in __xp_alloc
Subsystems (4)
PATCH 1/1 xsk: fix clang build error in __xp_alloc
From: Magnus Karlsson <[email protected]>
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, so just remove it.
--- net/xdp/xsk_buff_pool.c | 1 - 1 file changed, 1 deletion(-)
net/xdp/xsk_buff_pool.c +0 -1
@@ -462,7 +462,6 @@ static struct xdp_buff_xsk *__xp_alloc(struct xsk_buff_pool *pool)for (;;) {if (!xskq_cons_peek_addr_unchecked (pool->fq, &addr)) { pool->fq->queue_empty_descs++; -xp_release (xskb);return NULL ; }
base-commit: 72e1781a5de9e3ee804e24f7ce9a7dd85596fc51
Signature · 1 line
2.29.0
Quoted 4 lines · Magnus Karlsson
From: Magnus Karlsson <[email protected]>
Fix a build error with clang in
__xp_alloc().
Quoted 8 lines
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, so just remove it.
Quoted 25 lines
Fixes 94033cd8e73b ("xsk: Optimize for aligned case")Reported-by Nathan Chancellor <[email protected]>Signed-off-by Magnus Karlsson <[email protected]>--- net/xdp/xsk_buff_pool.c | 1 - 1 file changed, 1 deletion(-)net/xdp/xsk_buff_pool.c +0
-1@@ -462,7 +462,6 @@ static struct xdp_buff_xsk *__xp_alloc(struct xsk_buff_pool *pool)for (;;) {if (!xskq_cons_peek_addr_unchecked (pool->fq, &addr)) { pool->fq->queue_empty_descs++; -xp_release (xskb);return NULL ; }base-commit:
72e1781a5de9e3ee804e24f7ce9a7dd85596fc51Signature · 1 line
2.29.0
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Quoted 10 lines · On Wed, 29 Sep 2021 08:14:03 +0200 you wrote:
From: Magnus Karlsson <[email protected]>
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); ^~~~[...]
Here is the summary with links:
- [bpf-next] xsk: fix clang build error in __xp_alloc
https://git.kernel.org/bpf/bpf-next/c/3103836496e7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html