Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c928ed55 authored by Haggai Abramonvsky's avatar Haggai Abramonvsky Committed by David S. Miller
Browse files

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



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

Signed-off-by: default avatarHaggai Abramovsky <hagaya@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dcc38c03
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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 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);
}