diff options
Diffstat (limited to 'arch/s390/net/bpf_jit_comp.c')
-rw-r--r-- | arch/s390/net/bpf_jit_comp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index d5f10a43a58..16871da3737 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -12,8 +12,8 @@ #include <linux/random.h> #include <linux/init.h> #include <asm/cacheflush.h> -#include <asm/processor.h> #include <asm/facility.h> +#include <asm/dis.h> /* * Conventions: @@ -156,8 +156,8 @@ static void bpf_jit_prologue(struct bpf_jit *jit) EMIT6(0xeb8ff058, 0x0024); /* lgr %r14,%r15 */ EMIT4(0xb90400ef); - /* ahi %r15,<offset> */ - EMIT4_IMM(0xa7fa0000, (jit->seen & SEEN_MEM) ? -112 : -80); + /* aghi %r15,<offset> */ + EMIT4_IMM(0xa7fb0000, (jit->seen & SEEN_MEM) ? -112 : -80); /* stg %r14,152(%r15) */ EMIT6(0xe3e0f098, 0x0024); } else if ((jit->seen & SEEN_XREG) && (jit->seen & SEEN_LITERAL)) @@ -805,7 +805,7 @@ static struct bpf_binary_header *bpf_alloc_binary(unsigned int bpfsize, return NULL; memset(header, 0, sz); header->pages = sz / PAGE_SIZE; - hole = sz - bpfsize + sizeof(*header); + hole = sz - (bpfsize + sizeof(*header)); /* Insert random number of illegal instructions before BPF code * and make sure the first instruction starts at an even address. */ @@ -881,7 +881,9 @@ void bpf_jit_free(struct sk_filter *fp) struct bpf_binary_header *header = (void *)addr; if (fp->bpf_func == sk_run_filter) - return; + goto free_filter; set_memory_rw(addr, header->pages); module_free(NULL, header); +free_filter: + kfree(fp); } |