]> www.infradead.org Git - users/hch/dma-mapping.git/commitdiff
bpf, test_run: Use kvfree() for memory allocated with kvmalloc()
authorYihao Han <hanyihao@vivo.com>
Thu, 10 Mar 2022 09:28:27 +0000 (01:28 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 10 Mar 2022 15:20:02 +0000 (16:20 +0100)
It is allocated with kvmalloc(), the corresponding release function
should not be kfree(), use kvfree() instead.

Generated by: scripts/coccinelle/api/kfree_mismatch.cocci

Fixes: b530e9e1063e ("bpf: Add "live packet" mode for XDP in BPF_PROG_RUN")
Signed-off-by: Yihao Han <hanyihao@vivo.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20220310092828.13405-1-hanyihao@vivo.com
net/bpf/test_run.c

index 0acdc37c841513bd14adabef51d12c6a39bac100..24405a280a9b03f03eb092473022b4e22282b1dc 100644 (file)
@@ -196,9 +196,9 @@ static int xdp_test_run_setup(struct xdp_test_data *xdp, struct xdp_buff *orig_c
 err_mmodel:
        page_pool_destroy(pp);
 err_pp:
-       kfree(xdp->skbs);
+       kvfree(xdp->skbs);
 err_skbs:
-       kfree(xdp->frames);
+       kvfree(xdp->frames);
        return err;
 }