Merge tag 'fsnotify_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / net / openvswitch / datapath.c
index a61818e943969936ba4cc2c49818b7b889d5faf5..0f5ce77460d44099277e142e37d11620e426e9cb 100644 (file)
@@ -1578,8 +1578,9 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
                goto err_destroy_table;
        }
 
-       dp->ports = kmalloc(DP_VPORT_HASH_BUCKETS * sizeof(struct hlist_head),
-                           GFP_KERNEL);
+       dp->ports = kmalloc_array(DP_VPORT_HASH_BUCKETS,
+                                 sizeof(struct hlist_head),
+                                 GFP_KERNEL);
        if (!dp->ports) {
                err = -ENOMEM;
                goto err_destroy_percpu;