Date: Sat, 1 Apr 2017 08:40:47 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316346 - stable/11/sys/x86/iommu Message-ID: <201704010840.v318elXx038421@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sat Apr 1 08:40:47 2017 New Revision: 316346 URL: https://svnweb.freebsd.org/changeset/base/316346 Log: MFC r315934: Avoid leaking allocated but unused context after creation race. Modified: stable/11/sys/x86/iommu/intel_ctx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/11/sys/x86/iommu/intel_ctx.c Sat Apr 1 08:37:19 2017 (r316345) +++ stable/11/sys/x86/iommu/intel_ctx.c Sat Apr 1 08:40:47 2017 (r316346) @@ -472,13 +472,15 @@ dmar_get_ctx_for_dev(struct dmar_unit *d dmar->unit, dmar->segment, bus, slot, func, rid, domain->domain, domain->mgaw, domain->agaw, id_mapped ? "id" : "re"); + dmar_unmap_pgtbl(sf); } else { - /* Nothing needs to be done to destroy ctx1. */ + dmar_unmap_pgtbl(sf); dmar_domain_destroy(domain1); + /* Nothing needs to be done to destroy ctx1. */ + free(ctx1, M_DMAR_CTX); domain = ctx->domain; ctx->refs++; /* tag referenced us */ } - dmar_unmap_pgtbl(sf); } else { domain = ctx->domain; ctx->refs++; /* tag referenced us */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704010840.v318elXx038421>