]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 10 Nov 2017 06:39:21 +0000 (15:39 +0900)
commit7c86ad8d2f636886a5243df4fd686d8dabad1b6b
tree17bd1896764b82285889c2c0efca9df0dc24efad
parenteb8410af4b16da141f9c9fc7496e1b9bc643ebd4
net/mlx5e: Set page to null in case dma mapping fails

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