aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nfnetlink_log.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2005-11-03 19:20:07 +0100
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-11-05 16:35:27 -0200
commit10dfdc69ea07d5a6c24406755f5e8de95a1b8901 (patch)
tree2004603342d995ec88d53f3e6160e04befe498ef /net/netfilter/nfnetlink_log.c
parent[NETFILTER]: Fix double free after netlink_unicast() in ctnetlink (diff)
downloadlinux-dev-10dfdc69ea07d5a6c24406755f5e8de95a1b8901.tar.xz
linux-dev-10dfdc69ea07d5a6c24406755f5e8de95a1b8901.zip
[NETFILTER] nfnetlink: Use kzalloc
These is a cleanup patch, kzalloc can be used in a couple of cases Signed-off-by: Samir Bellabes <sbellabes@mandriva.com> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/netfilter/nfnetlink_log.c')
-rw-r--r--net/netfilter/nfnetlink_log.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index efcd10f996ba..d194676f3655 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -146,11 +146,10 @@ instance_create(u_int16_t group_num, int pid)
goto out_unlock;
}
- inst = kmalloc(sizeof(*inst), GFP_ATOMIC);
+ inst = kzalloc(sizeof(*inst), GFP_ATOMIC);
if (!inst)
goto out_unlock;
- memset(inst, 0, sizeof(*inst));
INIT_HLIST_NODE(&inst->hlist);
inst->lock = SPIN_LOCK_UNLOCKED;
/* needs to be two, since we _put() after creation */
@@ -962,10 +961,9 @@ static int nful_open(struct inode *inode, struct file *file)
struct iter_state *is;
int ret;
- is = kmalloc(sizeof(*is), GFP_KERNEL);
+ is = kzalloc(sizeof(*is), GFP_KERNEL);
if (!is)
return -ENOMEM;
- memset(is, 0, sizeof(*is));
ret = seq_open(file, &nful_seq_ops);
if (ret < 0)
goto out_free;