s/M_WAITOK/M_NOWAIT/ while mutex is held.
Pointed out by: csjp
This commit is contained in:
parent
23a8fc28c2
commit
6a96c4832f
@ -105,7 +105,7 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, int *mem)
|
||||
|
||||
/* Allocate the reference table for the jumps */
|
||||
stream.refs = (u_int *)malloc((nins + 1) * sizeof(u_int),
|
||||
M_BPFJIT, M_WAITOK);
|
||||
M_BPFJIT, M_NOWAIT);
|
||||
if (stream.refs == NULL)
|
||||
return NULL;
|
||||
|
||||
@ -459,7 +459,7 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, int *mem)
|
||||
if (pass == 2)
|
||||
break;
|
||||
|
||||
stream.ibuf = (char *)malloc(stream.cur_ip, M_BPFJIT, M_WAITOK);
|
||||
stream.ibuf = (char *)malloc(stream.cur_ip, M_BPFJIT, M_NOWAIT);
|
||||
if (stream.ibuf == NULL) {
|
||||
free(stream.refs, M_BPFJIT);
|
||||
return NULL;
|
||||
|
@ -105,7 +105,7 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, int *mem)
|
||||
|
||||
/* Allocate the reference table for the jumps */
|
||||
stream.refs = (u_int *)malloc((nins + 1) * sizeof(u_int),
|
||||
M_BPFJIT, M_WAITOK);
|
||||
M_BPFJIT, M_NOWAIT);
|
||||
if (stream.refs == NULL)
|
||||
return NULL;
|
||||
|
||||
@ -479,7 +479,7 @@ bpf_jit_compile(struct bpf_insn *prog, u_int nins, int *mem)
|
||||
if (pass == 2)
|
||||
break;
|
||||
|
||||
stream.ibuf = (char *)malloc(stream.cur_ip, M_BPFJIT, M_WAITOK);
|
||||
stream.ibuf = (char *)malloc(stream.cur_ip, M_BPFJIT, M_NOWAIT);
|
||||
if (stream.ibuf == NULL) {
|
||||
free(stream.refs, M_BPFJIT);
|
||||
return NULL;
|
||||
|
@ -53,13 +53,13 @@ bpf_jitter(struct bpf_insn *fp, int nins)
|
||||
|
||||
/* Allocate the filter structure */
|
||||
filter = (struct bpf_jit_filter *)malloc(sizeof(struct bpf_jit_filter),
|
||||
M_BPFJIT, M_WAITOK);
|
||||
M_BPFJIT, M_NOWAIT);
|
||||
if (filter == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Allocate the filter's memory */
|
||||
filter->mem = (int *)malloc(BPF_MEMWORDS * sizeof(int),
|
||||
M_BPFJIT, M_WAITOK);
|
||||
M_BPFJIT, M_NOWAIT);
|
||||
if (filter->mem == NULL) {
|
||||
free(filter, M_BPFJIT);
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user