aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
Diffstat (limited to 'net/core')
-rw-r--r--net/core/filter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index d814b8a89d0f..37f8eb06fdee 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -933,7 +933,7 @@ static struct bpf_prog *bpf_migrate_filter(struct bpf_prog *fp)
933 933
934 /* Expand fp for appending the new filter representation. */ 934 /* Expand fp for appending the new filter representation. */
935 old_fp = fp; 935 old_fp = fp;
936 fp = krealloc(old_fp, bpf_prog_size(new_len), GFP_KERNEL); 936 fp = bpf_prog_realloc(old_fp, bpf_prog_size(new_len), 0);
937 if (!fp) { 937 if (!fp) {
938 /* The old_fp is still around in case we couldn't 938 /* The old_fp is still around in case we couldn't
939 * allocate new memory, so uncharge on that one. 939 * allocate new memory, so uncharge on that one.
@@ -1013,7 +1013,7 @@ int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog)
1013 if (fprog->filter == NULL) 1013 if (fprog->filter == NULL)
1014 return -EINVAL; 1014 return -EINVAL;
1015 1015
1016 fp = kmalloc(bpf_prog_size(fprog->len), GFP_KERNEL); 1016 fp = bpf_prog_alloc(bpf_prog_size(fprog->len), 0);
1017 if (!fp) 1017 if (!fp)
1018 return -ENOMEM; 1018 return -ENOMEM;
1019 1019
@@ -1069,7 +1069,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
1069 if (fprog->filter == NULL) 1069 if (fprog->filter == NULL)
1070 return -EINVAL; 1070 return -EINVAL;
1071 1071
1072 prog = kmalloc(bpf_fsize, GFP_KERNEL); 1072 prog = bpf_prog_alloc(bpf_fsize, 0);
1073 if (!prog) 1073 if (!prog)
1074 return -ENOMEM; 1074 return -ENOMEM;
1075 1075