diff options
author | kib <kib@FreeBSD.org> | 2013-10-28 19:30:09 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-10-28 19:30:09 +0000 |
commit | 04c60e5a2102c47f185a51c67295b045620b901a (patch) | |
tree | 3247578b971b16b4a976693dd43f443c5d39da72 /sys/x86 | |
parent | 311b50384f1f3d0b645ac322319b5c1081a62184 (diff) | |
download | FreeBSD-src-04c60e5a2102c47f185a51c67295b045620b901a.zip FreeBSD-src-04c60e5a2102c47f185a51c67295b045620b901a.tar.gz |
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
Diffstat (limited to 'sys/x86')
-rw-r--r-- | sys/x86/iommu/busdma_dmar.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/x86/iommu/busdma_dmar.c b/sys/x86/iommu/busdma_dmar.c index 5249f30..df8799a 100644 --- a/sys/x86/iommu/busdma_dmar.c +++ b/sys/x86/iommu/busdma_dmar.c @@ -163,18 +163,15 @@ dmar_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, 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); |