Browse Source

net/mlx5_core: Check the return value of mlx5_command_exec()

mlx5_cmd_exec() might fail - need to check return value.

Signed-off-by: Haggai Abramovsky <hagaya@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Haggai Abramonvsky 10 years ago
parent
commit
c928ed5517
1 changed files with 6 additions and 1 deletions
  1. 6 1
      drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h

+ 6 - 1
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h

@@ -73,7 +73,12 @@ static inline int mlx5_cmd_exec_check_status(struct mlx5_core_dev *dev, u32 *in,
 					     int in_size, u32 *out,
 					     int in_size, u32 *out,
 					     int out_size)
 					     int out_size)
 {
 {
-	mlx5_cmd_exec(dev, in, in_size, out, out_size);
+	int err;
+
+	err = mlx5_cmd_exec(dev, in, in_size, out, out_size);
+	if (err)
+		return err;
+
 	return mlx5_cmd_status_to_err((struct mlx5_outbox_hdr *)out);
 	return mlx5_cmd_status_to_err((struct mlx5_outbox_hdr *)out);
 }
 }