Author: kib
Date: Mon Oct 28 19:30:09 2013
New Revision: 257266
URL: http://svnweb.freebsd.org/changeset/base/257266

Log:
  Remove redundand assignment to error variable and check for its value [1].
  Do CTR logging in the case of error as well.
  
  Noted by:     rdivacky [1]
  Sponsored by: The FreeBSD Foundation
  MFC after:    1 month

Modified:
  head/sys/x86/iommu/busdma_dmar.c

Modified: head/sys/x86/iommu/busdma_dmar.c
==============================================================================
--- head/sys/x86/iommu/busdma_dmar.c    Mon Oct 28 18:43:00 2013        
(r257265)
+++ head/sys/x86/iommu/busdma_dmar.c    Mon Oct 28 19:30:09 2013        
(r257266)
@@ -163,18 +163,15 @@ dmar_bus_dma_tag_create(bus_dma_tag_t pa
            nsegments, maxsegsz, flags, lockfunc, lockfuncarg,
            sizeof(struct bus_dma_tag_dmar), (void **)&newtag);
        if (error != 0)
-               return (error);
+               goto out;
 
        oldtag = (struct bus_dma_tag_dmar *)parent;
        newtag->common.impl = &bus_dma_dmar_impl;
        newtag->ctx = oldtag->ctx;
        newtag->owner = oldtag->owner;
-       error = 0;
 
-       if (error != 0)
-               free(newtag, M_DEVBUF);
-       else
-               *dmat = (bus_dma_tag_t)newtag;
+       *dmat = (bus_dma_tag_t)newtag;
+out:
        CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d",
            __func__, newtag, (newtag != NULL ? newtag->common.flags : 0),
            error);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to