From patchwork Tue Jun 25 00:15:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lira, Victor M" X-Patchwork-Id: 13710340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7028BC2BD09 for ; Tue, 25 Jun 2024 00:16:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.746991.1154231 (Exim 4.92) (envelope-from ) id 1sLtrC-0000OE-DL; Tue, 25 Jun 2024 00:16:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 746991.1154231; Tue, 25 Jun 2024 00:16:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sLtrC-0000O7-9i; Tue, 25 Jun 2024 00:16:22 +0000 Received: by outflank-mailman (input) for mailman id 746991; Tue, 25 Jun 2024 00:16:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sLtrA-0000O1-TN for xen-devel@lists.xenproject.org; Tue, 25 Jun 2024 00:16:21 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20611.outbound.protection.outlook.com [2a01:111:f403:200a::611]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 24e475e0-3288-11ef-90a3-e314d9c70b13; Tue, 25 Jun 2024 02:16:19 +0200 (CEST) Received: from PH7P220CA0039.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32b::26) by CH3PR12MB7499.namprd12.prod.outlook.com (2603:10b6:610:142::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.30; Tue, 25 Jun 2024 00:16:14 +0000 Received: from CY4PEPF0000EE3E.namprd03.prod.outlook.com (2603:10b6:510:32b:cafe::b) by PH7P220CA0039.outlook.office365.com (2603:10b6:510:32b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.38 via Frontend Transport; Tue, 25 Jun 2024 00:16:14 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EE3E.mail.protection.outlook.com (10.167.242.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 25 Jun 2024 00:16:13 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 24 Jun 2024 19:16:12 -0500 Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 24 Jun 2024 19:16:11 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 24e475e0-3288-11ef-90a3-e314d9c70b13 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NmdHNuamfhd1lf3IrcwJmSHqV+OnPiklhe7+U1VxAN0b76uopsBMJxEnUName88EsmoBz0mXFpMddIRe1uIHxTAweLCatU5TXigof+QsDdxQMWtLzdr9aUvdDV7hoLY3U2c+a018Hv8v8v/zLiJzK1wj8wMFS7RSxEH5mx04IeWU7yoCzaOOQ264LfqBNuLGvuTT0E7+VFydjr4sjR0ySIci0X9gqiTVx27T5sPzlnrrmovE6tOF+ymFRcBnqIt8PZZuwlqfp8+3ium4NAzomoJhpMmq0CPGmBi4Au6vbQHy5Eya3jU63nxSI18WZVzOAHnmOwk1zwAk/ujnPYVsCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aK6pT63F+/FKNnG3FTGMH16+l8vr5szLZBk4uhshQUc=; b=DZm+Pl30ArVMTjBQ77YeMbOutjRx4b4KJxT/pAW3bDRMYOGDTIDfa/4nU3zCj4uKDhwazOA0vYwjRDLrnNxX2qVQBgFo23+paFVZ6Adq1swL2F4NQmQUjAk2ZsO4DMrJo61tZq/u/SIyvZbjuzzwCRY3bgpYL93RbJ65Z7+k9tCHno3DsepohBLrwq+u+NJj4N0XzqcSVqN415FcpHv3dqByXNCnz5CL7VbFEhoTQgGrwb6qp/yR//P9RgMigfIfN+kv2m3yehqeze9GcHFdkCW07ptamr84LNL5XeYJDvMCMnAUQOG+BNP/qa0rD0ainK5H5NoMfA/VLbvFqggsAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aK6pT63F+/FKNnG3FTGMH16+l8vr5szLZBk4uhshQUc=; b=m6uBNtXCQlKjLT0NU45c7/b6biX7qsRpYlTdIk6u2UdLAG/NFwIGNc4Q6+WVUQctyOKqAB6AWfanHz727GbNoHN/0SD1qksLMy1xPHvAPWco/vH1CxAZ4XzvLEgj8IUOS/zxwQwQmYm34ZiIlX57dtwRdNafMIXgX8EfZd9Ft9w= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: To: CC: Victor Lira , George Dunlap , Dario Faggioli , "Juergen Gross" Subject: [XEN PATCH] common/sched: address a violation of MISRA C Rule 17.7 Date: Mon, 24 Jun 2024 17:15:39 -0700 Message-ID: X-Mailer: git-send-email 2.37.6 MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: victorm.lira@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3E:EE_|CH3PR12MB7499:EE_ X-MS-Office365-Filtering-Correlation-Id: bee44850-dd3f-4b27-a2bf-08dc94ac0634 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|376011|36860700010|1800799021|82310400023; X-Microsoft-Antispam-Message-Info: yZPMHY7cn1otF/nUDmmDbFGyB198wylYE1mPP8DziI2JWGaRqIw12SsVvwqIJuAdSqdV4l0x/R9tfif/rgq4uODm5FoGrE30h+wiXhgVMM3FMr/LQtAm45496NE2Id0QxWnvf3NGD2Mj62hizlrPedlZy5rKA1FoVSvEgP+HKZlVX2BwouxPLxCCj5cUr+r1g3VWoIFdryvRQ6iRiOb6gmJdoMdM6scCrCbT508nlUPAv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EAHyPcsp5d+acRCQFGkxChTKZdIY3/KRsoqe9vkmR2ZgpY7AJ6I3r/NKAQ29O4b8Skc+nJ/tohPIqYZ4nTE/fhZgRN9aKaf7qxIzosd6qyhq3wgZ8GUy6fA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230037)(376011)(36860700010)(1800799021)(82310400023);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2024 00:16:13.7916 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bee44850-dd3f-4b27-a2bf-08dc94ac0634 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7499 From: Victor Lira Rule 17.7: "The value returned by a function having non-void return type shall be used" This patch fixes this by adding a check to the return value. No functional changes. Signed-off-by: Victor Lira --- Cc: George Dunlap Cc: Dario Faggioli Cc: Juergen Gross Cc: xen-devel@lists.xenproject.org --- xen/common/sched/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index d84b65f197..e1cd824622 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -2789,7 +2789,10 @@ static int cpu_schedule_up(unsigned int cpu) BUG_ON(cpu >= NR_CPUS); if ( idle_vcpu[cpu] == NULL ) - vcpu_create(idle_vcpu[0]->domain, cpu); + { + if ( vcpu_create(idle_vcpu[0]->domain, cpu) == NULL ) + return -ENOMEM; + } else idle_vcpu[cpu]->sched_unit->res = sr;