Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 2013 19:30:09 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257266 - head/sys/x86/iommu
Message-ID:  <201310281930.r9SJU9b8004065@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310281930.r9SJU9b8004065>