net/mlx5_core: Check the return value of mlx5_command_exec()
authorHaggai Abramonvsky <hagaya@mellanox.com>
Wed, 29 Jul 2015 12:05:39 +0000 (15:05 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Jul 2015 06:04:46 +0000 (23:04 -0700)
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>
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h

index fc88ecaecb4b4307f2d5c796cc91c548e856f845..566a70488db12ddef46f5623cb77c3e1e4c4ab2c 100644 (file)
@@ -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);
 }