mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 21:45:45 +02:00
sfc: Do not free an empty page_ring
[ Upstream commit458f5d92df] When the page_ring is not used page_ptr_mask is 0. Do not dereference page_ring[0] in this case. Fixes:2768935a46("sfc: reuse pages to avoid DMA mapping/unmapping costs") Reported-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0ac74169eb
commit
d8992b393f
|
|
@ -166,6 +166,9 @@ static void efx_fini_rx_recycle_ring(struct efx_rx_queue *rx_queue)
|
||||||
struct efx_nic *efx = rx_queue->efx;
|
struct efx_nic *efx = rx_queue->efx;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (unlikely(!rx_queue->page_ring))
|
||||||
|
return;
|
||||||
|
|
||||||
/* Unmap and release the pages in the recycle ring. Remove the ring. */
|
/* Unmap and release the pages in the recycle ring. Remove the ring. */
|
||||||
for (i = 0; i <= rx_queue->page_ptr_mask; i++) {
|
for (i = 0; i <= rx_queue->page_ptr_mask; i++) {
|
||||||
struct page *page = rx_queue->page_ring[i];
|
struct page *page = rx_queue->page_ring[i];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user