From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 494F236F8E6 for ; Mon, 1 Jun 2026 19:56:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780343803; cv=none; b=bpmzUxVfkISYcxo6iJELehv2uF9tsnzpXnYpV2T4Bwo74/bJhr51B/nsLdGpJKrQEl1QhfGCIHtwQfD4jyr8qQsd4Qk/HMvf0jzZlKk0lpK8+dUbP3XoUmubBZ2HQaRsdWAT71G6RYjegEJ8DmE1PGU0lQhNtNVsDHrpj//mtfY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780343803; c=relaxed/simple; bh=TKc6gWppFBsDVx6x4J5vR8ORMiG/xUxRFM8fxE7zof4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D4PTMQU4MN0Ah4Y3K5ckat+34A22VkGBcaqOyt/3CID5cHQBPhZvqgb4saSvMcPz9AFJgxTmEI1ENGR9bPcS5io/t1F8v2JBmKuGwsFI54lKxdbrChNIZ6ycvM81ShFkd3PtkjP/ZSulQqTOC06RqWrhUWwxDD5rEbf2SBnP7c0= 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=lDT9mPTA; arc=none smtp.client-ip=198.175.65.21 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="lDT9mPTA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1780343803; x=1811879803; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TKc6gWppFBsDVx6x4J5vR8ORMiG/xUxRFM8fxE7zof4=; b=lDT9mPTAbeziW1w4b/ASZX5tMz3pN8S3QK27MyM61JDEhIfqLeCakRkD XyUHloB05HaBSJIYPRbScRtQhypTwNVZ+YCnIoEy9LoPoFfrneywiOVwo VLiRTRpLyjDnM4NiRdA6rhGfK0JK6zXh/BKiFYQTZphQ0G6PKm1oxoiSY Wp+tM9YNuqJGrr4HnDYtrRQCXboeOQ7iRh2j438shb8zYUgna0HAP56s5 a/HMC/BK2ipa6CytlkVWeujIT4P45yJD3D4BecuzEqmVqOXbfAXNs8MXi lrqHQXEO8X6V451l/7Uu6PR3U0E4bDCXw2ox5gEPlt/kUtoDfpHWmLuce g==; X-CSE-ConnectionGUID: 4HiRB+hoS/OteeHNkEMpXA== X-CSE-MsgGUID: lpwa9FXCR0aGx6ecZAh5yg== X-IronPort-AV: E=McAfee;i="6800,10657,11804"; a="81011567" X-IronPort-AV: E=Sophos;i="6.24,181,1774335600"; d="scan'208";a="81011567" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2026 12:56:41 -0700 X-CSE-ConnectionGUID: zfxHr8X9S4GzqSysE6NxjA== X-CSE-MsgGUID: Y5M5YCjSTsauvDSib0OTPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,181,1774335600"; d="scan'208";a="247946493" Received: from lstrano-mobl6.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.221.168]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2026 12:56:39 -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 v7 02/14] fs/resctrl: Free mon_data structures on rdt_get_tree() failure Date: Mon, 1 Jun 2026 12:56:20 -0700 Message-ID: <20260601195632.15876-3-tony.luck@intel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260601195632.15876-1-tony.luck@intel.com> References: <20260601195632.15876-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 Signed-off-by: Reinette Chatre Signed-off-by: Tony Luck Reviewed-by: Ben Horgan Reviewed-by: Chen Yu --- 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