Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp178291imd; Wed, 31 Oct 2018 16:54:05 -0700 (PDT) X-Google-Smtp-Source: AJdET5dp0gAfE7DmgzkDbdvXC3o4N0SX4k9B/PYSesHQVJw6z2HXGY+pFPaQbnqhehIW/kDYWO1U X-Received: by 2002:a17:902:a5c6:: with SMTP id t6-v6mr5423842plq.31.1541030045941; Wed, 31 Oct 2018 16:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541030045; cv=none; d=google.com; s=arc-20160816; b=SGuAJytMDPRJYACVEoRnEPr49cuh05NpROZlVjZ8kxCBmXHatuXL4vQAP22xuSuUGC qRztA3IJQoBGkBnN9xEt6xRssrhP4bTfWlw/YkacU39M3oYWBEK8fZ7PAFdVumC/Jup2 K6QL+e+xzPtst6pitJxAoiqMYtgnBW141G/RteEE1oB+lbEQBfckXisP/emmZooEukK9 +o1pU+/Ojoocz1ZoygPfKSibmkSSXytHWcIFdgoUSmav/xqXSZ9YctpZ7/DDF3Bj/+9V fMeZioKpuucGzeAGo+8oLV8jMSqisAB15lXeL4dEYeKLP4DsoX4do+lizh9AsJfZVa0a 6JNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DJ24lLXnGR/In3swOB2EqHPE+ffN9XwlNDSD3Iytr7k=; b=Ildsx1fZ3tki1KaAkMLbZK5bWMOxYV3bnDOBNYK79GKP5aFU9aBcFwc2CqOwP/YcnT wEjdiUMbIrXlN+vgmriBFsA2bNLTFAnrEmMadiKiCoCAmPFmxHOjyfgsMS+6Z9+k6kCh 5gjD65Vi4JZUeaqju3GdBm8AQTvJABpkjb3RN0D1O9a55fK0CJiubl6t7HQQOai530rL F/YRAV7oM7ojgHQd1AJNvj+BxUNiPhkJGaW+hNdGxYqxRlpC6aqSOP03GtuCiQ6KpB7t fl4s0gKsAKFWftJKthPHutE9oV7/ndCTDCDg6jgnsJAMM1nXyS//+Py5U/kmeunbLoxh rUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="u+C9r/No"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id m7-v6si27635001pls.358.2018.10.31.16.53.51; Wed, 31 Oct 2018 16:54:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="u+C9r/No"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728225AbeKAIwj (ORCPT + 99 others); Thu, 1 Nov 2018 04:52:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:53310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727838AbeKAIGY (ORCPT ); Thu, 1 Nov 2018 04:06:24 -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 A0DCE20830; Wed, 31 Oct 2018 23:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027174; bh=oyGb2u5HLv10meYeOi6geGjQjtinMeZQNFbByG/F+5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u+C9r/NovMolLCkr3py2sf/e9qNJXnGbJuHUOpWKbXR0PbtYHz2VxH60hYzBBbqqL X1a2Y+Aw6PVTQKBjR6U0/pghS4ulRhU/FJA+9kXN/HGz1X0KDmV61aWPpZzdS5H9EU DE/v/REp/gzGppfDgn/sVMxusRdh0sFFRNITbJiw= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dou Liyang , "Rafael J . Wysocki" , Sasha Levin Subject: [PATCH AUTOSEL 4.19 035/146] ACPI / processor: Fix the return value of acpi_processor_ids_walk() Date: Wed, 31 Oct 2018 19:03:50 -0400 Message-Id: <20181031230541.28822-35-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dou Liyang [ Upstream commit d0381bf4f80c571dde1244fe5b85dc35e8b3f546 ] ACPI driver should make sure all the processor IDs in their ACPI Namespace are unique. the driver performs a depth-first walk of the namespace tree and calls the acpi_processor_ids_walk() to check the duplicate IDs. But, the acpi_processor_ids_walk() mistakes the return value. If a processor is checked, it returns true which causes the walk break immediately, and other processors will never be checked. Repace the value with AE_OK which is the standard acpi_status value. And don't abort the namespace walk even on error. Fixes: 8c8cb30f49b8 (acpi/processor: Implement DEVICE operator for processor enumeration) Signed-off-by: Dou Liyang Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpi_processor.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 449d86d39965..fc447410ae4d 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -643,7 +643,7 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle, status = acpi_get_type(handle, &acpi_type); if (ACPI_FAILURE(status)) - return false; + return status; switch (acpi_type) { case ACPI_TYPE_PROCESSOR: @@ -663,11 +663,12 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle, } processor_validated_ids_update(uid); - return true; + return AE_OK; err: + /* Exit on error, but don't abort the namespace walk */ acpi_handle_info(handle, "Invalid processor object\n"); - return false; + return AE_OK; } -- 2.17.1