treewide: kmalloc() -> kmalloc_array()
[linux-block.git] / drivers / net / ethernet / mellanox / mlx4 / cmd.c
index 6a9086dc1e92771fc454a1f0452b5f622c5f348c..03375c705df77b3d0c87f360f0cbd57831b9e7f3 100644 (file)
@@ -2636,9 +2636,9 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev)
        int i;
        int err = 0;
 
-       priv->cmd.context = kmalloc(priv->cmd.max_cmds *
-                                  sizeof(struct mlx4_cmd_context),
-                                  GFP_KERNEL);
+       priv->cmd.context = kmalloc_array(priv->cmd.max_cmds,
+                                         sizeof(struct mlx4_cmd_context),
+                                         GFP_KERNEL);
        if (!priv->cmd.context)
                return -ENOMEM;