summaryrefslogtreecommitdiffstats
path: root/tools/net/bpf_jit_disasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/net/bpf_jit_disasm.c')
-rw-r--r--tools/net/bpf_jit_disasm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/net/bpf_jit_disasm.c b/tools/net/bpf_jit_disasm.c
index 5b3241340945..544b05a53b70 100644
--- a/tools/net/bpf_jit_disasm.c
+++ b/tools/net/bpf_jit_disasm.c
@@ -98,6 +98,9 @@ static char *get_klog_buff(unsigned int *klen)
char *buff;
len = klogctl(CMD_ACTION_SIZE_BUFFER, NULL, 0);
+ if (len < 0)
+ return NULL;
+
buff = malloc(len);
if (!buff)
return NULL;
OpenPOWER on IntegriCloud