aboutsummaryrefslogtreecommitdiff
path: root/kernel/bpf
diff options
context:
space:
mode:
authorGravatar Jakub Kicinski <kuba@kernel.org> 2022-01-27 12:54:16 -0800
committerGravatar Jakub Kicinski <kuba@kernel.org> 2022-01-27 12:54:16 -0800
commit72d044e4bfa6bd9096536e2e1c62aecfe1a525e4 (patch)
tree0e408f181f5c704ff43cd006f4643c339e04aff1 /kernel/bpf
parentptp: replace snprintf with sysfs_emit (diff)
parentMerge tag 'net-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadlinux-72d044e4bfa6bd9096536e2e1c62aecfe1a525e4.tar.gz
linux-72d044e4bfa6bd9096536e2e1c62aecfe1a525e4.tar.bz2
linux-72d044e4bfa6bd9096536e2e1c62aecfe1a525e4.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'kernel/bpf')
-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;