From d0b2f91bede3bd5e3d24dd6803e56eee959c1797 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Thu, 20 Oct 2016 00:10:27 -0300 Subject: Linux-libre 4.8.2-gnu --- net/kcm/kcmsock.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'net/kcm/kcmsock.c') diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c index 48613f5dd..411693288 100644 --- a/net/kcm/kcmsock.c +++ b/net/kcm/kcmsock.c @@ -1766,18 +1766,12 @@ static int kcm_attach_ioctl(struct socket *sock, struct kcm_attach *info) if (!csock) return -ENOENT; - prog = bpf_prog_get(info->bpf_fd); + prog = bpf_prog_get_type(info->bpf_fd, BPF_PROG_TYPE_SOCKET_FILTER); if (IS_ERR(prog)) { err = PTR_ERR(prog); goto out; } - if (prog->type != BPF_PROG_TYPE_SOCKET_FILTER) { - bpf_prog_put(prog); - err = -EINVAL; - goto out; - } - err = kcm_attach(sock, csock, prog); if (err) { bpf_prog_put(prog); -- cgit v1.2.3-54-g00ecf