]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:14:14 +0000 (17:14 +0200)
commit32a2a078c4fd7782194806acc35c38192dd14805
tree7b15003ec25aab1ca2a287d6388808b19452f9a3
parent8e8abe6110a344fc8c270ad071256a9d115b47f2
iavf: Fix handling of dummy receive descriptors

[ Upstream commit 3b7d0d40be86cef501bd0855821d2b36a9e2d390 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/iavf/iavf_txrx.c