Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sfc: detach from cb_page in efx_copy_channel()

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: e9117e5099ea ("sfc: Firmware-Assisted TSO version 2")
Suggested-by: Derek Shute <Derek.Shute@stratus.com>
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Edward Cree and committed by
David S. Miller
4b1bd9db 661388f9

+1
+1
drivers/net/ethernet/sfc/efx_channels.c
··· 583 583 if (tx_queue->channel) 584 584 tx_queue->channel = channel; 585 585 tx_queue->buffer = NULL; 586 + tx_queue->cb_page = NULL; 586 587 memset(&tx_queue->txd, 0, sizeof(tx_queue->txd)); 587 588 } 588 589