Message ID | 1477255075-15255-5-git-send-email-kadlec@blackhole.kfki.hu |
---|---|
State | Accepted |
Delegated to: | Pablo Neira |
Headers | show |
On Sun, Oct 23, 2016 at 10:37:37PM +0200, Jozsef Kadlecsik wrote: > Allocate memory with kmalloc() rather than kzalloc(). > > Ported from a patch proposed by Sergey Popovich <popovich_sergei@mail.ua>. > > Suggested-by: Sergey Popovich <popovich_sergei@mail.ua> > Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> > --- > include/linux/netfilter/ipset/ip_set_comment.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/netfilter/ipset/ip_set_comment.h b/include/linux/netfilter/ipset/ip_set_comment.h > index bae5c76..5444b1b 100644 > --- a/include/linux/netfilter/ipset/ip_set_comment.h > +++ b/include/linux/netfilter/ipset/ip_set_comment.h > @@ -34,7 +34,7 @@ > return; > if (unlikely(len > IPSET_MAX_COMMENT_SIZE)) > len = IPSET_MAX_COMMENT_SIZE; > - c = kzalloc(sizeof(*c) + len + 1, GFP_ATOMIC); > + c = kmalloc(sizeof(*c) + len + 1, GFP_ATOMIC); It would be better to indicate in the description why kzalloc is useless. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/netfilter/ipset/ip_set_comment.h b/include/linux/netfilter/ipset/ip_set_comment.h index bae5c76..5444b1b 100644 --- a/include/linux/netfilter/ipset/ip_set_comment.h +++ b/include/linux/netfilter/ipset/ip_set_comment.h @@ -34,7 +34,7 @@ return; if (unlikely(len > IPSET_MAX_COMMENT_SIZE)) len = IPSET_MAX_COMMENT_SIZE; - c = kzalloc(sizeof(*c) + len + 1, GFP_ATOMIC); + c = kmalloc(sizeof(*c) + len + 1, GFP_ATOMIC); if (unlikely(!c)) return; strlcpy(c->str, ext->comment, len + 1);
Allocate memory with kmalloc() rather than kzalloc(). Ported from a patch proposed by Sergey Popovich <popovich_sergei@mail.ua>. Suggested-by: Sergey Popovich <popovich_sergei@mail.ua> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> --- include/linux/netfilter/ipset/ip_set_comment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)