Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp118068ybg; Mon, 8 Jun 2020 18:06:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKE88y4g8cRbCxfS5/cBow10WIZLyZSnnOtXS5FW1qDm+O90Z1Sq0boZIB9njqabgNYl3A X-Received: by 2002:a17:906:f10a:: with SMTP id gv10mr22268118ejb.309.1591664798993; Mon, 08 Jun 2020 18:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664798; cv=none; d=google.com; s=arc-20160816; b=Gxt9aXEn+Ec8j5Jv0pLz1tJE9FTb7E7llV1v41xKehtkYhu1VCTwjFJwJRdFtVw+nm ttaPKP17nQaJJUAOcD0NEpmBZbBllHitmBLVwYP0u3tg0hk89MrEKnGe7k+3MhDHVEta 8z9TD+6GA5M5BwzMTb9Zjg84BxBwOlAfnoBfRLwfNFVms8+XkVSp2NUwZU62HpMd31Qv R9si3Sa0c47YEgGX8RUNoUUP+woW5VSQYjYFk8/tS8si1d4UBz12xITrWeB8wB5yzKTH Z+lwVcWNEIO3Ae83zuWJEvgQwwUASe/Gr9ZhGWcky94xsHeWbORZtDcVFjHjIFCFWWcE uXRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C+7g38fh87EcgB7ikgTbQGeYqMg0sA5PVZcOsDFSca8=; b=TObrhyylvk1CtlLXys/8kKLz4i4DHqZ0g8cGPycrfydBAVkn1jTjcvbOX+qlkLq8vT k5ld3a2dZEbcTXP/ffX21vG598IWEwVtmL7HLoIayIrIYMB/w+Smeq+MvdNb3GnKS7Ab uRwppbplwPqk9U3Qr6oUX/fWum2kkuk5AmG+DPUAxpoNJ8524b70E0yaIZZvZA+7K9kW 18rB97wsokGFMb2A2lxcWZwm3hqkeqbLfPU2oqVS+iEakm5Jcs97nnOF/qQXMOd8JPJh 9HwlBl3nZmsIVc5iF4NCBC9vc5BRi8Wbm0JNxbd4/pURYAriKrBtOmGa+SByWGZCzQMe tOHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gSQKOebe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx19si9527888edb.395.2020.06.08.18.06.16; Mon, 08 Jun 2020 18:06:38 -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; dkim=pass header.i=@kernel.org header.s=default header.b=gSQKOebe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727892AbgFHXHZ (ORCPT + 99 others); Mon, 8 Jun 2020 19:07:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:50480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbgFHXG6 (ORCPT ); Mon, 8 Jun 2020 19:06:58 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 779F92087E; Mon, 8 Jun 2020 23:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657617; bh=0dgaXx1o/v3uoLpNkiitvqOB3bdGazxh/NQXbfODV44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gSQKOebe+UQW6KnFs/9KkHhzb39jkvAOvuN5a/gGqGpMzLmP0XUHDehzOJLmyI07f zFotgcRjYoI9WNDr7sgrl7kjBsHt0DSjPqoeDaJRWxdvMEWd1r37DmQg10Ts478tAJ NrGU3sQFhN9WLPhCmg4dLVdlqu/MoXBLsS6MqDkY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Erik Kaneda , Kurt Kennett , Bob Moore , "Rafael J . Wysocki" , Sasha Levin , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH AUTOSEL 5.7 039/274] ACPICA: Dispatcher: add status checks Date: Mon, 8 Jun 2020 19:02:12 -0400 Message-Id: <20200608230607.3361041-39-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Erik Kaneda [ Upstream commit 6bfe5344b2956d0bee116f1c640aef05e5cddd76 ] ACPICA commit 3244c1eeba9f9fb9ccedb875f7923a3d85e0c6aa The status chekcs are used to to avoid NULL pointer dereference on field objects Link: https://github.com/acpica/acpica/commit/3244c1ee Reported-by: Kurt Kennett Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/dsfield.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c index c901f5aec739..5725baec60f3 100644 --- a/drivers/acpi/acpica/dsfield.c +++ b/drivers/acpi/acpica/dsfield.c @@ -514,13 +514,20 @@ acpi_ds_create_field(union acpi_parse_object *op, info.region_node = region_node; status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + if (info.region_node->object->region.space_id == - ACPI_ADR_SPACE_PLATFORM_COMM - && !(region_node->object->field.internal_pcc_buffer = - ACPI_ALLOCATE_ZEROED(info.region_node->object->region. - length))) { - return_ACPI_STATUS(AE_NO_MEMORY); + ACPI_ADR_SPACE_PLATFORM_COMM) { + region_node->object->field.internal_pcc_buffer = + ACPI_ALLOCATE_ZEROED(info.region_node->object->region. + length); + if (!region_node->object->field.internal_pcc_buffer) { + return_ACPI_STATUS(AE_NO_MEMORY); + } } + return_ACPI_STATUS(status); } -- 2.25.1