]> git.baikalelectronics.ru Git - kernel.git/commit
iavf: Fix handling of dummy receive descriptors
authorPrzemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Sat, 25 Jun 2022 00:33:01 +0000 (17:33 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 18 Jul 2022 16:36:40 +0000 (09:36 -0700)
commit3b7d0d40be86cef501bd0855821d2b36a9e2d390
treebae38de96c384ef1b70778407734757fdce8de4e
parent6052902c8ab4d7c8cd4746b81516118e07223958
iavf: Fix handling of dummy receive descriptors

Fix memory leak caused by not handling dummy receive descriptor properly.
iavf_get_rx_buffer now sets the rx_buffer return value for dummy receive
descriptors. Without this patch, when the hardware writes a dummy
descriptor, iavf would not free the page allocated for the previous receive
buffer. This is an unlikely event but can still happen.

[Jesse: massaged commit message]

Fixes: cff135bd1f71 ("iavf: allow null RX descriptors")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_txrx.c