Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux-2.6-microblaze.git] / net / netfilter / nf_tables_api.c
index d23a5c2..896d4a3 100644 (file)
@@ -5304,7 +5304,7 @@ static int nf_tables_flowtable_parse_hook(const struct nft_ctx *ctx,
        if (err < 0)
                return err;
 
-       ops = kzalloc(sizeof(struct nf_hook_ops) * n, GFP_KERNEL);
+       ops = kcalloc(n, sizeof(struct nf_hook_ops), GFP_KERNEL);
        if (!ops)
                return -ENOMEM;
 
@@ -7178,8 +7178,8 @@ static int __init nf_tables_module_init(void)
 
        nft_chain_filter_init();
 
-       info = kmalloc(sizeof(struct nft_expr_info) * NFT_RULE_MAXEXPRS,
-                      GFP_KERNEL);
+       info = kmalloc_array(NFT_RULE_MAXEXPRS, sizeof(struct nft_expr_info),
+                            GFP_KERNEL);
        if (info == NULL) {
                err = -ENOMEM;
                goto err1;