Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[linux-2.6-microblaze.git] / drivers / net / ethernet / mellanox / mlx5 / core / fs_core.c
index f9c2c03..e1b609c 100644 (file)
@@ -1191,8 +1191,7 @@ static struct mlx5_flow_handle *alloc_handle(int num_rules)
 {
        struct mlx5_flow_handle *handle;
 
-       handle = kzalloc(sizeof(*handle) + sizeof(handle->rule[0]) *
-                         num_rules, GFP_KERNEL);
+       handle = kzalloc(struct_size(handle, rule, num_rules), GFP_KERNEL);
        if (!handle)
                return NULL;