netfilter: nfnl_cthelper: Replace kzalloc with kcalloc
Subsystems (2)
PATCH 1/1 netfilter: nfnl_cthelper: Replace kzalloc with kcalloc
kcalloc is preferred to allocate an array instead of kzalloc. This patch fixes checkpatch isssue.
Signed-off-by Harsha Sharma <[email protected]>
--- net/netfilter/nfnetlink_cthelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nfnetlink_cthelper.c +1 -1
@@ -189,7 +189,7 @@ nfnl_cthelper_parse_expect_policy(struct nf_conntrack_helper *helper,if (class_max >NF_CT_MAX_EXPECT_CLASSES )return -EOVERFLOW ; - expect_policy =kzalloc (sizeof (struct nf_conntrack_expect_policy ) * + expect_policy =kcalloc (sizeof (struct nf_conntrack_expect_policy ) * class_max,GFP_KERNEL );if (expect_policy ==NULL )return -ENOMEM ;
Signature · 1 line
2.11.0
Florian Westphal
maintainerQuoted 13 lines · Harsha Sharma
kcalloc is preferred to allocate an array instead of kzalloc. This patch fixes checkpatch isssue.
Signed-off-by Harsha Sharma <[email protected]>--- net/netfilter/nfnetlink_cthelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/netfilter/nfnetlink_cthelper.c +0
-0
net/netfilter/nfnetlink_cthelper.c nfnl_cthelper_parse_expect_policy(struct nf_conntrack_helper *helper, · line 193
Quoted 6 lines
net/netfilter/nfnetlink_cthelper.c +1
-1@@ -189,7 +189,7 @@ nfnl_cthelper_parse_expect_policy(struct nf_conntrack_helper *helper,if (class_max >NF_CT_MAX_EXPECT_CLASSES )return -EOVERFLOW ; - expect_policy =kzalloc (sizeof (struct nf_conntrack_expect_policy ) * + expect_policy =kcalloc (sizeof (struct nf_conntrack_expect_policy ) * class_max,GFP_KERNEL );
Please at least compile test patches.