Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 090b7402 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

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: 528f7272 ("vxge: code cleanup and reorganization")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f83beff2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2365,6 +2365,7 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size,
				dma_object->addr))) {
			vxge_os_dma_free(devh->pdev, memblock,
				&dma_object->acc_handle);
			memblock = NULL;
			goto exit;
		}