summaryrefslogtreecommitdiffstats
path: root/kernel/bpf
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-08-18 09:27:02 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-18 19:18:20 +0200
commitae2b27b859a144f503d382580320873c0beb09c7 (patch)
tree08251cb6077167a861775b00370bfbe5fe4d2bc6 /kernel/bpf
parentMerge branch 'liquidio-initialization-fixes-for-embedded-firmware' (diff)
downloadlinux-ae2b27b859a144f503d382580320873c0beb09c7.tar.xz
linux-ae2b27b859a144f503d382580320873c0beb09c7.zip
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: 174a79ff9515 ("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>
Diffstat (limited to 'kernel/bpf')
-rw-r--r--kernel/bpf/syscall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index d2f2bdf71ffa..b8cb1b3c9bfb 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -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)