net/mlx5: Fix flow counter bulk command out mailbox allocation
[deliverable/linux.git] / drivers / net / ethernet / mellanox / mlx5 / core / fs_cmd.c
index 9134010e2921cb1ace000d05832c636667d2a5ba..287ade151ec849861a5d9c18eb27f8c7c7014f7a 100644 (file)
@@ -425,11 +425,11 @@ struct mlx5_cmd_fc_bulk *
 mlx5_cmd_fc_bulk_alloc(struct mlx5_core_dev *dev, u16 id, int num)
 {
        struct mlx5_cmd_fc_bulk *b;
-       int outlen = sizeof(*b) +
+       int outlen =
                MLX5_ST_SZ_BYTES(query_flow_counter_out) +
                MLX5_ST_SZ_BYTES(traffic_counter) * num;
 
-       b = kzalloc(outlen, GFP_KERNEL);
+       b = kzalloc(sizeof(*b) + outlen, GFP_KERNEL);
        if (!b)
                return NULL;
 
This page took 0.024178 seconds and 5 git commands to generate.