Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1310780pxb; Fri, 24 Sep 2021 01:26:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwylhpX8nVLNeh43u4sUp8Av0OeOx7eoOD/85610+H200m7YE6E6nSPfQYJrD02sW9sjRZa X-Received: by 2002:a5e:8d07:: with SMTP id m7mr7624946ioj.31.1632471966757; Fri, 24 Sep 2021 01:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632471966; cv=none; d=google.com; s=arc-20160816; b=0VSpgFxetSxosy9E+GbxMrpPr5HwooFhpZhebuJ8SlZpxo1rZEDU38zKYL7XkEtDzv OkWXRLH2HEmdIpGsh/p0dfkXexKyM96KMz0YCvPJMDTz0Rqj9aH21PKIaSDLOTp0SGcH C2EKvi8hCx472zxqRTU5w38cvviuOrgXSEm25leLsjUuCDyj0JmxxmPX5bLGrJw3O5b2 qsbkdc8+RUD0j0ZxwQ8QdaxWaHSfFr5wBUPvL2FVXc1dHTwdQ5HWg9I0YAStGzwmSe0s 4FhZooz0AqgsTOVlj1bVJiyoDIuvIUDJ0UyZw/uzCXlxQgARP+GmK7gIwVCtpfQuUemU NMNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr; bh=WgNIvpN4t5ZTLFvB7AdnGc8/S+xI8IfE7jrpBn2VnMM=; b=dXB4OxacLVHpBIp1FxlFFDmXoGGY3QFst+eyerrMN0CRx073mNL1ZvYUWSNzINw76I JKnyOnxlTpOlUeP7XmW4Ad+3YcEiNFVfcPeTFziFCOKroZQCkt7Zj6jslQ5Aiw9g0Nfp sIJitmA75p9NI8CrVTX4rJHgLfdfhknmg50ysGz8YckV3WPdvmdmpap2nFNQmYOC/FVK pGTOPNe5NAVqk/V032Xg4rOuziJJmXqvqUvFBPXS2UbicWVjSR/s53CXP3WcqipJS618 OXaV1jhgkbrEL/UWG6YayT/OROfUPC0JcmBFWP7dmKjgdUvyvt2SMvCLB3mv0wq+HOcM G/MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r195si9503877ior.17.2021.09.24.01.25.55; Fri, 24 Sep 2021 01:26:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244704AbhIXI0P (ORCPT + 99 others); Fri, 24 Sep 2021 04:26:15 -0400 Received: from esa10.hc1455-7.c3s2.iphmx.com ([139.138.36.225]:16752 "EHLO esa10.hc1455-7.c3s2.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244707AbhIXI0O (ORCPT ); Fri, 24 Sep 2021 04:26:14 -0400 X-Greylist: delayed 426 seconds by postgrey-1.27 at vger.kernel.org; Fri, 24 Sep 2021 04:26:14 EDT IronPort-SDR: z0DgfYjJ++ZxbVDhHb6xJS7JSQP7x/1gZs6sjF8dAVhRpON0CwHmJmh5+C4nWsvYDbxKHNCW2g NdsthFlXNllZ2d2XHmc6J49qy7aqAbRnrqICClrzxoolPj1ushit3wyQBK7Jz0/h1J4b8e8+QD Pyl3q1zNUxITOTwx3FMerdPz7nJ5zsFGiN0uEtHmdtScvLZRTqwG1GF+uAznrmTZBnl0/RSoe1 YtoGSou1WGuzqkJcnc4wS4mKSOz82it5IMbuSouTCzFUTmZ7ckd5yrUnOBOUYdutvJmfXOElMo RhwEWzTGYmIfMmR+RUzzwU1u X-IronPort-AV: E=McAfee;i="6200,9189,10116"; a="34174853" X-IronPort-AV: E=Sophos;i="5.85,319,1624287600"; d="scan'208";a="34174853" Received: from unknown (HELO yto-r4.gw.nic.fujitsu.com) ([218.44.52.220]) by esa10.hc1455-7.c3s2.iphmx.com with ESMTP; 24 Sep 2021 17:17:32 +0900 Received: from yto-m1.gw.nic.fujitsu.com (yto-nat-yto-m1.gw.nic.fujitsu.com [192.168.83.64]) by yto-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id 186ED6CC26 for ; Fri, 24 Sep 2021 17:17:32 +0900 (JST) Received: from oym-om1.fujitsu.com (oym-om1.o.css.fujitsu.com [10.85.58.161]) by yto-m1.gw.nic.fujitsu.com (Postfix) with ESMTP id 5C3E9C9CFB for ; Fri, 24 Sep 2021 17:17:31 +0900 (JST) Received: from localhost.localdomain (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om1.fujitsu.com (Postfix) with ESMTP id 24FD34011E82E; Fri, 24 Sep 2021 17:17:31 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , tan.shaopeng@jp.fujitsu.com Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH] x86/resctrl: Fix return code in mkdir_rdt_prepare() Date: Fri, 24 Sep 2021 17:17:13 +0900 Message-Id: <20210924081713.502039-1-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When kzalloc fails, we should return ENOMEM instead of ENOSPC. Signed-off-by: Shaopeng Tan --- Hello, I just noticed this when I read the code. Thanks, arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index b57b3db9a6a7..a92d047476f6 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2854,7 +2854,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, /* allocate the rdtgroup. */ rdtgrp = kzalloc(sizeof(*rdtgrp), GFP_KERNEL); if (!rdtgrp) { - ret = -ENOSPC; + ret = -ENOMEM; rdt_last_cmd_puts("Kernel out of memory\n"); goto out_unlock; } -- 2.27.0