bpf: Fix uprobe_multi get_pid_task error path
Subsystems (4)
Jiri Olsa
reviewerPATCH 1/1 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 <[email protected]>
Signed-off-by Jiri Olsa <[email protected]>
--- kernel/trace/bpf_trace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/trace/bpf_trace.c +3 -1
@@ -3223,8 +3223,10 @@ int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prrcu_read_lock (); task =get_pid_task (find_vpid (pid),PIDTYPE_PID );rcu_read_unlock (); -if (!task) +if (!task) { + err = -ESRCH ; goto error_path_put; + } } err = -ENOMEM ;
Signature · 1 line
2.41.0
Quoted 7 lines · Jiri Olsa
Dan reported Smatch static checker warning due to missing error value set in uprobe multi link's
get_pid_taskerror path.Reported-by Dan Carpenter <[email protected]>Signed-off-by Jiri Olsa <[email protected]>
Reviewed-by Song Liu <[email protected]>
Quoted 24 lines
--- kernel/trace/bpf_trace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)kernel/trace/bpf_trace.c +3
-2@@ -3223,8 +3223,10 @@ int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prrcu_read_lock (); task =get_pid_task (find_vpid (pid),PIDTYPE_PID );rcu_read_unlock (); -if (!task) +if (!task) { + err = -ESRCH ; goto error_path_put; + } } err = -ENOMEM ; --2.41.0
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <[email protected]>:
Quoted 8 lines · On Fri, 15 Sep 2023 12:14:20 +0200 you wrote:
Dan reported Smatch static checker warning due to missing error value set in uprobe multi link's
get_pid_taskerror path.Reported-by Dan Carpenter <[email protected]>Signed-off-by Jiri Olsa <[email protected]>[...]
Here is the summary with links:
- [bpf] bpf: Fix uprobe_multi get_pid_task error path
https://git.kernel.org/bpf/bpf/c/57eb5e1c5c57
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html