Skip to content

Commit 57eb5e1

Browse files
olsajiriAlexei Starovoitov
authored andcommitted
bpf: Fix uprobe_multi get_pid_task error path
Dan reported Smatch static checker warning due to missing error value set in uprobe multi link's get_pid_task error path. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/bpf/c5ffa7c0-6b06-40d5-aca2-63833b5cd9af@moroto.mountain/ Signed-off-by: Jiri Olsa <jolsa@kernel.org> Reviewed-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20230915101420.1193800-1-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent dca7acd commit 57eb5e1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

kernel/trace/bpf_trace.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3223,8 +3223,10 @@ int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr
32233223
rcu_read_lock();
32243224
task = get_pid_task(find_vpid(pid), PIDTYPE_PID);
32253225
rcu_read_unlock();
3226-
if (!task)
3226+
if (!task) {
3227+
err = -ESRCH;
32273228
goto error_path_put;
3229+
}
32283230
}
32293231

32303232
err = -ENOMEM;

0 commit comments

Comments
 (0)