diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2015-04-02 17:07:26 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-02 23:33:41 +0300 |
commit | 05e4ecd1dc8b085a9010f20dcb5409b25488480a (patch) | |
tree | 68b56742635a9b56f836a1b19c2979b2c858eb5a /drivers | |
parent | 64599cca51de08cef94bc13a0f98351e5bb01f41 (diff) | |
download | linux-05e4ecd1dc8b085a9010f20dcb5409b25488480a.tar.xz |
net/mlx5_core: Avoid copying outbox in aysnc command completion
Avoid copying to the output buffer in cmd_exec since this is done after the
command is completed. Failure to do this may cause cases where the callback
handler is called before the copy done by cmd_exec which then overwrites it.
Reported-by: Tamer Hleihel <tamerh@mellanox.com>
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 43a73d36b01d..290ae87fdef7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -1236,7 +1236,8 @@ static int cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, goto out_out; } - err = mlx5_copy_from_msg(out, outb, out_size); + if (!callback) + err = mlx5_copy_from_msg(out, outb, out_size); out_out: if (!callback) |