From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 883DE314D18 for ; Mon, 15 Jun 2026 18:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781547910; cv=none; b=crELcDj05KkEMmrgbti8YLUfFuTQ4jwoGyR0Z3lczbgPmlR7RwxLRTUVMUAjzNFD0YeQ/4+DAHnhKpFsab7V/U0qAnJ/Hcp53NqUxqkfEKiAznqSuVEfjE0gAxktUJ7jBK/H6Fm/SgAFN2oi/1CRBluVlyz1u4g9ltkeygYagPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781547910; c=relaxed/simple; bh=rrS+ShOnTIe+Z2HmkEebbrrhPJuER4oUO425uK51bII=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DoCYbTKnBpV4YEZSsXS/eOriSfWbM+GubC4h1JxBjBaYBVbl0BdKr2T2lRBea8pc2VG8IuowOSxn7Xce8eaukGjNxgeytMpZ/97ruHofqwTpqearfro2AbSyb1vdu8NRI7txGhuKzWWTLp3kUSXluvIi8NeDeUz0ykC9YHnWkjk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jdcucTE7; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jdcucTE7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781547908; x=1813083908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rrS+ShOnTIe+Z2HmkEebbrrhPJuER4oUO425uK51bII=; b=jdcucTE7l20Lgk1kzyCkOaZCdVaKB450cNq5jaHh8hUc70oDzVRwHy7i r7q+Nl91zZhVs9IEI7GoldIFhmDFuu9WO+igaAdUjyp99u1Dfb85/NiP0 QHbI04bkB8vEcLasniLY+GQn5me46W1e2Z9upEXbskxL03NAfjlXBouZ7 BXb+Aht2AXyBlM5wRQgJAIEcKZQFz1wjJrRzeaZnNA29nPNpqvs1KwP3T 64dHvKkRxBN+NBZcFE24M3upICpHJVm4P/9n/uobZaFigx+lfERBjZ0x5 Eil7zspKnKVAzKAZnbCiQgJRHeQHj2P/WLgP6kXU8ipWHtCQft65cM1Im w==; X-CSE-ConnectionGUID: dhtCoEmwS8+cuDxOt+ib0g== X-CSE-MsgGUID: MN5LJ00CRmSgw0FKIU1HNQ== X-IronPort-AV: E=McAfee;i="6800,10657,11818"; a="93789928" X-IronPort-AV: E=Sophos;i="6.24,206,1774335600"; d="scan'208";a="93789928" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2026 11:25:06 -0700 X-CSE-ConnectionGUID: Hiw8gGhmTdSRUJDF0M5Pjw== X-CSE-MsgGUID: YWU09aL2SBSc7ZRCMbp/dQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,206,1774335600"; d="scan'208";a="247620593" Received: from spandruv-desk1.amr.corp.intel.com (HELO agluck-desk3.intel.com) ([10.124.221.121]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2026 11:25:06 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck , Ben Horgan Subject: [PATCH v8 02/16] fs/resctrl: Free mon_data structures on rdt_get_tree() failure Date: Mon, 15 Jun 2026 11:24:43 -0700 Message-ID: <20260615182457.14725-3-tony.luck@intel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260615182457.14725-1-tony.luck@intel.com> References: <20260615182457.14725-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If mkdir_mondata_all() or a subsequent call in rdt_get_tree() fails, the mon_data structures allocated by mon_get_kn_priv() are leaked. Add mon_put_kn_priv() to the out_mongrp error path to free the mon_data structures. Fixes: 2a6566038544 ("x86/resctrl: Expand the width of domid by replacing mon_data_bits") Reported-by: Reinette Chatre Closes: https://lore.kernel.org/lkml/5d38c1fb-8f91-472b-8897-24b2f50c772b@intel.com/ Signed-off-by: Tony Luck Signed-off-by: Reinette Chatre Reviewed-by: Chen Yu Reviewed-by: Ben Horgan --- fs/resctrl/rdtgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index a6376a3fc4c3..506b40dc9430 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -3071,6 +3071,7 @@ static int rdt_get_tree(struct fs_context *fc) kernfs_remove(kn_mondata); out_mongrp: if (resctrl_arch_mon_capable()) { + mon_put_kn_priv(); rdtgroup_unassign_cntrs(&rdtgroup_default); kernfs_remove(kn_mongrp); } -- 2.54.0