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>
This commit is contained in:
Eli Cohen 2015-04-02 17:07:26 +03:00 committed by David S. Miller
parent 64599cca51
commit 05e4ecd1dc
1 changed files with 2 additions and 1 deletions

View File

@ -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)