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

Commit 0a2c34f1 authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller
Browse files

vxge: fix return of a free'd memblock on a failed dma mapping



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>
parent bddc028a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2366,6 +2366,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;
		}