]> git.baikalelectronics.ru Git - kernel.git/commitdiff
selftests/bpf: Remove memory leak
authorBjörn Töpel <bjorn.topel@intel.com>
Fri, 22 Jan 2021 15:47:17 +0000 (16:47 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 25 Jan 2021 23:05:01 +0000 (00:05 +0100)
The allocated entry is immediately overwritten by an assignment. Fix
that.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210122154725.22140-5-bjorn.topel@gmail.com
tools/testing/selftests/bpf/xdpxceiver.c

index 77d1bda37afa2c5b5178effbc135469e60062e68..9f40d310805ac0b6f09380fe35e47bd4497d8468 100644 (file)
@@ -728,7 +728,6 @@ static void worker_pkt_validate(void)
        u32 payloadseqnum = -2;
 
        while (1) {
-               pkt_node_rx_q = malloc(sizeof(struct pkt));
                pkt_node_rx_q = TAILQ_LAST(&head, head_s);
                if (!pkt_node_rx_q)
                        break;