Commit 1d0d6bd6 authored by Jozsef Kadlecsik's avatar Jozsef Kadlecsik
Browse files

netfilter: ipset: Use kmalloc() in comment extension helper

Allocate memory with kmalloc() rather than kzalloc(): the string
is immediately initialized so it is unnecessary to zero out
the allocated memory area.

Ported from a patch proposed by Sergey Popovich <>.

Suggested-by: default avatarSergey Popovich <>
Signed-off-by: default avatarJozsef Kadlecsik <>
parent bec810d9
......@@ -34,7 +34,7 @@ ip_set_init_comment(struct ip_set_comment *comment,
if (unlikely(len > IPSET_MAX_COMMENT_SIZE))
c = kzalloc(sizeof(*c) + len + 1, GFP_ATOMIC);
c = kmalloc(sizeof(*c) + len + 1, GFP_ATOMIC);
if (unlikely(!c))
strlcpy(c->str, ext->comment, len + 1);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment