From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 ED77C17EC for ; Thu, 17 Nov 2022 04:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668657661; x=1700193661; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=17CL2FjZPUEz4ImeXbJSJ2yXwkCtWsI2L+00dokYk/Q=; b=IrOZK/9FqnMV52aEpDgbTfud9t47CdZ5Sqt2eT+whE24upBcjzVanU3K WTpY9S5mA+NHCuF7Ds8aoCStocsXs/tDq8IzPMBIu9v9a/VBqFm3BtBGk U20cj1s8VIKpOSpb2PfR7HaYtjiEI0kUhc2ZiBvuU+EVyYQc+2j/Zcmx1 1FvmXKStCL+4v+XJ6bMVVAio3uI6lp5xYZf2sGH8pA2ASQD9m1+at7dOx aYAoRWyBDnIJYK+3x+LYoZ8+yZRyR8042j+3BiHnpIXWynm7garLkTWSu SwijZ8j0vgmfOXW2xsWR0JZBvIuQrMK+0T3q8CfEkYqG2Ey31DeSdEbGE A==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="399038879" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="399038879" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 20:00:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="590462653" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="590462653" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 20:00:55 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 02/16] platform/x86/intel/ifs: Return a more appropriate Error code Date: Wed, 16 Nov 2022 19:59:21 -0800 Message-Id: <20221117035935.4136738-3-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221117035935.4136738-1-jithu.joseph@intel.com> References: <20221107225323.2733518-1-jithu.joseph@intel.com> <20221117035935.4136738-1-jithu.joseph@intel.com> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit scan_chunks_sanity_check() returns -ENOMEM if it encounters an error while copying IFS test image from memory to Secure Memory. Return -EIO in this scenario, as it is more appropriate. Reviewed-by: Tony Luck Reviewed-by: Sohil Mehta Reviewed-by: Hans de Goede Signed-off-by: Jithu Joseph --- drivers/platform/x86/intel/ifs/load.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c index d056617ddc85..89ce265887ea 100644 --- a/drivers/platform/x86/intel/ifs/load.c +++ b/drivers/platform/x86/intel/ifs/load.c @@ -157,8 +157,10 @@ static int scan_chunks_sanity_check(struct device *dev) INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks); schedule_work_on(cpu, &local_work.w); wait_for_completion(&ifs_done); - if (ifsd->loading_error) + if (ifsd->loading_error) { + ret = -EIO; goto out; + } package_authenticated[curr_pkg] = 1; } ret = 0; -- 2.25.1