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)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 30 Aug 2017 18:20:43 +0000 (21:20 +0300)
commit0556ce72ab16156af6c94cdc7964e4310acc97c0
tree0ccd97c3e7a4a131f2214ff2a135975e3a096a71
parent10a8d00707082955b177164d4b4e758ffcbd4017
net/mlx5e: Fix dangling page pointer on DMA mapping error

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>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c