Skip to content

Commit 0a2c34f

Browse files
Colin Ian Kingdavem330
authored andcommitted
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: 528f727 ("vxge: code cleanup and reorganization") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bddc028 commit 0a2c34f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/neterion/vxge/vxge-config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,6 +2366,7 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size,
23662366
dma_object->addr))) {
23672367
vxge_os_dma_free(devh->pdev, memblock,
23682368
&dma_object->acc_handle);
2369+
memblock = NULL;
23692370
goto exit;
23702371
}
23712372

0 commit comments

Comments
 (0)