vxge: fix return of a free'd memblock on a failed dma mapping
authorColin Ian King <colin.king@canonical.com>
Fri, 12 Apr 2019 13:45:12 +0000 (14:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:41:21 +0000 (19:41 +0200)
commit090b740200147839228a019b2ed80d139398e095
tree5dc2a70f941fb40a161ce9f1fc6bf3825e2d4b5f
parentf83beff280480438df97d7189582db7abdf208ba
vxge: fix return of a free'd memblock on a failed dma mapping

[ Upstream commit 0a2c34f18c94b596562bf3d019fceab998b8b584 ]

Currently if a pci dma mapping failure is detected a free'd
memblock address is returned rather than a NULL (that indicates
an error). Fix this by ensuring NULL is returned on this error case.

Addresses-Coverity: ("Use after free")
Fixes: 528f727279ae ("vxge: code cleanup and reorganization")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/neterion/vxge/vxge-config.c