]> git.baikalelectronics.ru Git - kernel.git/commitdiff
bpf: Remove unnecessary assertion on fp_old
authorAditya Pakki <pakki001@umn.edu>
Thu, 19 Dec 2019 17:57:35 +0000 (11:57 -0600)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 19 Dec 2019 21:24:15 +0000 (22:24 +0100)
The two callers of bpf_prog_realloc - bpf_patch_insn_single and
bpf_migrate_filter dereference the struct fp_old, before passing
it to the function. Thus assertion to check fp_old is unnecessary
and can be removed.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191219175735.19231-1-pakki001@umn.edu
kernel/bpf/core.c

index 2ff01a7161284b308b2ef0eca85f68462a614b69..7622dfc36705d2ddc16988e922c535b79ab1720c 100644 (file)
@@ -222,8 +222,6 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
        u32 pages, delta;
        int ret;
 
-       BUG_ON(fp_old == NULL);
-
        size = round_up(size, PAGE_SIZE);
        pages = size / PAGE_SIZE;
        if (pages <= fp_old->pages)