mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
bpf: fix a return in sockmap_get_from_fd()
"map" is a valid pointer. We wanted to return "err" instead. Also
let's return a zero literal at the end.
Fixes: 174a79ff95
("bpf: sockmap with sk redirect support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
98ee2a1137
commit
ae2b27b859
@ -1125,11 +1125,11 @@ static int sockmap_get_from_fd(const union bpf_attr *attr, int ptype)
|
||||
fdput(f);
|
||||
bpf_prog_put(prog1);
|
||||
bpf_prog_put(prog2);
|
||||
return PTR_ERR(map);
|
||||
return err;
|
||||
}
|
||||
|
||||
fdput(f);
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bpf_prog_attach(const union bpf_attr *attr)
|
||||
|
Loading…
Reference in New Issue
Block a user