]> Git Repo - linux.git/commit
xdp: fix possible cq entry leak
authorIlya Maximets <[email protected]>
Thu, 4 Jul 2019 14:25:03 +0000 (17:25 +0300)
committerDaniel Borkmann <[email protected]>
Fri, 12 Jul 2019 12:54:57 +0000 (14:54 +0200)
commit675716400da6f15b9d3db04ef74ee74ca9a00af3
treebe8b1b96c494923785d8a8de31cb84e4d0e27d49
parent36db2a94f19ae1fcf1e6d8253df0c32f90f92860
xdp: fix possible cq entry leak

Completion queue address reservation could not be undone.
In case of bad 'queue_id' or skb allocation failure, reserved entry
will be leaked reducing the total capacity of completion queue.

Fix that by moving reservation to the point where failure is not
possible. Additionally, 'queue_id' checking moved out from the loop
since there is no point to check it there.

Fixes: 35fcde7f8deb ("xsk: support for Tx")
Signed-off-by: Ilya Maximets <[email protected]>
Acked-by: Björn Töpel <[email protected]>
Tested-by: William Tu <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
net/xdp/xsk.c
This page took 0.052401 seconds and 4 git commands to generate.