summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/neterion/vxge
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-04-12 14:45:12 +0100
committerDavid S. Miller <davem@davemloft.net>2019-04-12 16:54:41 -0700
commit0a2c34f18c94b596562bf3d019fceab998b8b584 (patch)
tree12148eca601733dc0c909d081100a819c2813b56 /drivers/net/ethernet/neterion/vxge
parentbddc028a4f2ac8cf4d0cd1c696b5f95d8305a553 (diff)
downloadlinux-0a2c34f18c94b596562bf3d019fceab998b8b584.tar.bz2
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: 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>
Diffstat (limited to 'drivers/net/ethernet/neterion/vxge')
-rw-r--r--drivers/net/ethernet/neterion/vxge/vxge-config.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
index 7cde387e5ec6..51cd57ab3d95 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c
@@ -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;
}