s390: replace kmalloc + memset with kzalloc
Subsystems (3)
PATCH 1/1 s390: replace kmalloc + memset with kzalloc
--- arch/s390/net/bpf_jit_comp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/s390/net/bpf_jit_comp.c +1 -2
@@ -747,10 +747,9 @@ void bpf_jit_compile(struct sk_filter *fp)if (!bpf_jit_enable)return ; - addrs =kmalloc (fp->len *sizeof (*addrs),GFP_KERNEL ); + addrs =kzalloc (fp->len *sizeof (*addrs),GFP_KERNEL );if (addrs ==NULL )return ; -memset (addrs,0 , fp->len *sizeof (*addrs));memset (&jit,0 ,sizeof (cjit));memset (&cjit,0 ,sizeof (cjit));
Signature · 1 line
1.7.10.4
Quoted 10 lines · Stelian Nirlu
Signed-off-by Stelian Nirlu <[email protected]>--- arch/s390/net/bpf_jit_comp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)arch/s390/net/bpf_jit_comp.c +0
-0
arch/s390/net/bpf_jit_comp.c void bpf_jit_compile(struct sk_filter *fp) · line 750
Quoted 5 lines
arch/s390/net/bpf_jit_comp.c +1
-1@@ -747,10 +747,9 @@ void bpf_jit_compile(struct sk_filter *fp)if (!bpf_jit_enable)return ; - addrs =kmalloc (fp->len *sizeof (*addrs),GFP_KERNEL ); + addrs =kzalloc (fp->len *sizeof (*addrs),GFP_KERNEL );
kcalloc() might be more appropriate here to protect against integer overflow if "fp->len" is too large.
Quoted 12 lines · Pekka Enberg
Quoted 11 lines · Stelian Nirlu
Signed-off-by Stelian Nirlu <[email protected]>--- arch/s390/net/bpf_jit_comp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)arch/s390/net/bpf_jit_comp.c +0
-0@@ -747,10 +747,9 @@ void bpf_jit_compile(struct sk_filter *fp)
Quoted 7 lines
arch/s390/net/bpf_jit_comp.c void bpf_jit_compile(struct sk_filter *fp) · line 750
Quoted 4 lines
arch/s390/net/bpf_jit_comp.c +1
-1if (!bpf_jit_enable)return ; - addrs =kmalloc (fp->len *sizeof (*addrs),GFP_KERNEL ); + addrs =kzalloc (fp->len *sizeof (*addrs),GFP_KERNEL );
kcalloc()might be more appropriate here to protect against integer overflow if "fp->len" is too large.
Stelian, care to send an updated patch which uses kcalloc() instead of kzalloc()?
A message that is not in the archive (sent off-list or not yet received): CACtXKtSzv666_FCHpVm0EkyW=c32kQA9o9-zDqVtJcFYk9mHqQ@mail.gmail.com
Quoted 27 lines · Stelian Nirlu
Quoted 24 lines · Heiko Carstens
Quoted 21 lines · Pekka Enberg
Quoted 11 lines · Stelian Nirlu
Signed-off-by Stelian Nirlu <[email protected]>--- arch/s390/net/bpf_jit_comp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)arch/s390/net/bpf_jit_comp.c +0
-0arch/s390/net/bpf_jit_comp.c void bpf_jit_compile(struct sk_filter *fp) · line 750
Quoted 5 lines
arch/s390/net/bpf_jit_comp.c +1
-1@@ -747,10 +747,9 @@ void bpf_jit_compile(struct sk_filter *fp)if (!bpf_jit_enable)return ; - addrs =kmalloc (fp->len *sizeof (*addrs),GFP_KERNEL ); + addrs =kzalloc (fp->len *sizeof (*addrs),GFP_KERNEL );
kcalloc()might be more appropriate here to protect against integer overflow if "fp->len" is too large.
Quoted 8 lines
Quoted 3 lines
Stelian, care to send an updated patch which uses
kcalloc()instead ofkzalloc()?Yes, sure, I will send the updated patch as soon as possible.
Thank you,
Stelian
I've sent the updated patch.
Mail subject: [PATCH v2] s390: use kcalloc instead of kmalloc and memset