summaryrefslogtreecommitdiff
path: root/kernel/bpf/stackmap.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2022-03-21 12:34:57 +0300
committerBorislav Petkov <bp@suse.de>2022-03-21 12:34:57 +0300
commit1422df58e5eb83dca131dc64e0f307a1f9e56078 (patch)
treef54bb7952a406cd783cbdbfe1b5ac4f80de02d68 /kernel/bpf/stackmap.c
parente1bca853dddcb57cbf084acbf35e3654cef6fc75 (diff)
parent2151c84ece920dc55942495004a823cbecb921e5 (diff)
downloadlinux-1422df58e5eb83dca131dc64e0f307a1f9e56078.tar.xz
Merge branch 'edac-amd64' into edac-updates-for-v5.18
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'kernel/bpf/stackmap.c')
-rw-r--r--kernel/bpf/stackmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index 49e567209c6b..22c8ae94e4c1 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -472,13 +472,14 @@ BPF_CALL_4(bpf_get_task_stack, struct task_struct *, task, void *, buf,
u32, size, u64, flags)
{
struct pt_regs *regs;
- long res;
+ long res = -EINVAL;
if (!try_get_task_stack(task))
return -EFAULT;
regs = task_pt_regs(task);
- res = __bpf_get_stack(regs, task, NULL, buf, size, flags);
+ if (regs)
+ res = __bpf_get_stack(regs, task, NULL, buf, size, flags);
put_task_stack(task);
return res;