From owner-dev-commits-src-all@freebsd.org Thu Feb 11 05:15:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8909A53AF18; Thu, 11 Feb 2021 05:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DblFK3SGGz4lC4; Thu, 11 Feb 2021 05:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 693282F2B; Thu, 11 Feb 2021 05:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B5FH3g012510; Thu, 11 Feb 2021 05:15:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B5FHhY012509; Thu, 11 Feb 2021 05:15:17 GMT (envelope-from git) Date: Thu, 11 Feb 2021 05:15:17 GMT Message-Id: <202102110515.11B5FHhY012509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ravi Pokala Subject: git: 40c1f835412d - stable/12 - nvdimm: Fix error path mis-free MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 40c1f835412d3e00901a146db6c317d654e65980 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 05:15:17 -0000 The branch stable/12 has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=40c1f835412d3e00901a146db6c317d654e65980 commit 40c1f835412d3e00901a146db6c317d654e65980 Author: Conrad Meyer AuthorDate: 2019-10-02 19:13:35 +0000 Commit: Ravi Pokala CommitDate: 2021-02-11 05:03:07 +0000 nvdimm: Fix error path mis-free (diff applied manually due to refactoring) Regression introduced in r343629 when malloc result was renamed from spa to spa_mapping and the 'spa' name was instead used to iterate a table, but the free() target was not updated. Reviewed by: kib, scottph Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21871 (cherry picked from commit 31f1c8fc84c850d73e74781126e12efceb50032b) --- sys/dev/nvdimm/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvdimm/nvdimm.c b/sys/dev/nvdimm/nvdimm.c index a2ab0f89a879..b2c716044d5d 100644 --- a/sys/dev/nvdimm/nvdimm.c +++ b/sys/dev/nvdimm/nvdimm.c @@ -460,7 +460,7 @@ nvdimm_root_create_spas(struct nvdimm_root_dev *dev, ACPI_TABLE_NFIT *nfitbl) error = nvdimm_spa_init(spa_mapping, *spa, spa_type); if (error != 0) { nvdimm_spa_fini(spa_mapping); - free(spa, M_NVDIMM); + free(spa_mapping, M_NVDIMM); break; } nvdimm_create_namespaces(spa_mapping, nfitbl);