* [PATCH] vxge: fix return of a free'd memblock on a failed dma mapping
@ 2019-04-12 13:45 Colin King
2019-04-12 23:54 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-04-12 13:45 UTC (permalink / raw)
To: Jon Mason, David S . Miller, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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>
---
drivers/net/ethernet/neterion/vxge/vxge-config.c | 1 +
1 file changed, 1 insertion(+)
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;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] vxge: fix return of a free'd memblock on a failed dma mapping
2019-04-12 13:45 [PATCH] vxge: fix return of a free'd memblock on a failed dma mapping Colin King
@ 2019-04-12 23:54 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-04-12 23:54 UTC (permalink / raw)
To: colin.king; +Cc: jdmason, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Fri, 12 Apr 2019 14:45:12 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-12 23:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-12 13:45 [PATCH] vxge: fix return of a free'd memblock on a failed dma mapping Colin King
2019-04-12 23:54 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).