From: Haggai Abramonvsky Date: Wed, 29 Jul 2015 12:05:39 +0000 (+0300) Subject: net/mlx5_core: Check the return value of mlx5_command_exec() X-Git-Tag: v4.3-rc1~96^2~266^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c928ed55171b3aa5e14a9474ffe60f31590b89ff;p=karo-tx-linux.git 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 Signed-off-by: Saeed Mahameed Signed-off-by: Amir Vadai Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h index fc88ecaecb4b..566a70488db1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +++ b/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 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); }