net/mlx5e: Set page to null in case dma mapping fails
authorInbar Karmy <inbark@mellanox.com>
Sun, 15 Oct 2017 14:30:59 +0000 (17:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Nov 2017 07:35:57 +0000 (08:35 +0100)
commitdd09c28f439ebf461505143dab2fd9175a164592
tree4099d854d15a06f96925415740b04438e4490cd4
parent63d10e93df94c93bdeac87a9401696b1edadb7ed
net/mlx5e: Set page to null in case dma mapping fails

[ Upstream commit 2e50b2619538ea0224c037f6fa746023089e0654 ]

Currently, when dma mapping fails, put_page is called,
but the page is not set to null. Later, in the page_reuse treatment in
mlx5e_free_rx_descs(), mlx5e_page_release() is called for the second time,
improperly doing dma_unmap (for a non-mapped address) and an extra put_page.
Prevent this by nullifying the page pointer when dma_map fails.

Fixes: accd58833237 ("net/mlx5e: Introduce RX Page-Reuse")
Signed-off-by: Inbar Karmy <inbark@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Cc: kernel-team@fb.com
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c