提交 05e4ecd1 编写于 作者: E Eli Cohen 提交者: David S. Miller

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: NTamer Hleihel <tamerh@mellanox.com>
Signed-off-by: NEli Cohen <eli@mellanox.com>
Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 64599cca
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册