提交 898c49df 编写于 作者: E Edward Cree 提交者: Yang Yingliang

sfc: detach from cb_page in efx_copy_channel()

[ Upstream commit 4b1bd9db078f7d5332c8601a2f5bd43cf0458fd4 ]

It's a resource, not a parameter, so we can't copy it into the new
 channel's TX queues, otherwise aliasing will lead to resource-
 management bugs if the channel is subsequently torn down without
 being initialised.

Before the Fixes:-tagged commit there was a similar bug with
 tsoh_page, but I'm not sure it's worth doing another fix for such
 old kernels.

Fixes: e9117e50 ("sfc: Firmware-Assisted TSO version 2")
Suggested-by: NDerek Shute <Derek.Shute@stratus.com>
Signed-off-by: NEdward Cree <ecree@solarflare.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 1d95d100
...@@ -522,6 +522,7 @@ efx_copy_channel(const struct efx_channel *old_channel) ...@@ -522,6 +522,7 @@ efx_copy_channel(const struct efx_channel *old_channel)
if (tx_queue->channel) if (tx_queue->channel)
tx_queue->channel = channel; tx_queue->channel = channel;
tx_queue->buffer = NULL; tx_queue->buffer = NULL;
tx_queue->cb_page = NULL;
memset(&tx_queue->txd, 0, sizeof(tx_queue->txd)); memset(&tx_queue->txd, 0, sizeof(tx_queue->txd));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册