net/mlx5e: Fix dangling page pointer on DMA mapping error
authorEran Ben Elisha <eranbe@mellanox.com>
Wed, 16 Aug 2017 11:37:11 +0000 (14:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Sep 2017 06:22:08 +0000 (08:22 +0200)
commitba008489371d05f5566ac31e140ed07fbb4f5fbb
treed65378e89699aa679c6d906b21aa0b1f89e94cd6
parent7ae1eccbde90e827633e31a397301d6c9053ed9c
net/mlx5e: Fix dangling page pointer on DMA mapping error

[ Upstream commit 0556ce72ab16156af6c94cdc7964e4310acc97c0 ]

Function mlx5e_dealloc_rx_wqe is using page pointer value as an
indication to valid DMA mapping. In case that the mapping failed, we
released the page but kept the dangling pointer. Store the page pointer
only after the DMA mapping passed to avoid invalid page DMA unmap.

Fixes: bc77b240b3c5 ("net/mlx5e: Add fragmented memory support for RX multi packet WQE")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.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