Author: mw
Date: Thu May 30 13:19:32 2019
New Revision: 348395
URL: https://svnweb.freebsd.org/changeset/base/348395

Log:
  Set vaddr and paddr as NULL when DMA alloc fails in ENA
  
  To prevent errors from assigning values from the DMA structure in case
  of an error, zero the vaddr and paddr values upon failure.
  
  Submitted by:  Michal Krawczyk <[email protected]>
  Obtained from: Semihalf
  Sponsored by:  Amazon, Inc.

Modified:
  head/sys/dev/ena/ena.c

Modified: head/sys/dev/ena/ena.c
==============================================================================
--- head/sys/dev/ena/ena.c      Thu May 30 13:18:23 2019        (r348394)
+++ head/sys/dev/ena/ena.c      Thu May 30 13:19:32 2019        (r348395)
@@ -279,6 +279,8 @@ fail_map_create:
        bus_dma_tag_destroy(dma->tag);
 fail_tag:
        dma->tag = NULL;
+       dma->vaddr = NULL;
+       dma->paddr = 0;
 
        return (error);
 }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to