From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D8C03183CB0; Tue, 10 Sep 2024 10:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725963209; cv=none; b=DFdOnIU5S+lZyCNzkw2b0nqTy97GNtaqT/nw8oXfTRkgf7kW9uGBwanQbVOKb8f1hvPdFf9CXM8wguK0uQdmfkUnfhHgwxKXk1dNmS1m7d/DCjij/6b/2gE0UZvJR/epc2ahw626/sHeUDxJ/XA8zHhohzXB7K7mJeHhOZzBK1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725963209; c=relaxed/simple; bh=GgnBOozT+zwLo0/pnghz2NSmTZh2+pOz/n8U0rniOzU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cdja0LbKR2I2JcCzFu1o63zBjGUrCRgmDIpbTrSjDtQkok/Beyqmu8ovGeV811jlyk7RwBr8XQypfkEYbLRpyd+EKd98QGoQiToD0qSGu0ea4TLqywI/JZuR5m5DqPxClFD05e71c+Hx4Qcb5P7z5vKTTrtYzdfwg7O3sy/nXlg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lfR923Ar; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lfR923Ar" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55B6AC4CEC3; Tue, 10 Sep 2024 10:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725963209; bh=GgnBOozT+zwLo0/pnghz2NSmTZh2+pOz/n8U0rniOzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lfR923ArdumeYfsYbtXPf6+OzFOoyni6Lf/r5zc3nsjOGJzfWWi0/inzPnqN55hmb Ni+RbBw5MxGvI/OX639ZOrdLa/DOK5/x0xJVgym6s0M3xevNjv3uXvSGn4fPH9pCTa zcfNW+Q6xrxMslg+GKqNP1FJD5VjYNpoMYTQMois= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Rafael J. Wysocki" , "Rafael J. Wysocki" , Gavin Shan , Jonathan Cameron , Catalin Marinas , Sasha Levin Subject: [PATCH 6.1 165/192] ACPI: processor: Return an error if acpi_processor_get_info() fails in processor_add() Date: Tue, 10 Sep 2024 11:33:09 +0200 Message-ID: <20240910092604.712333487@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092557.876094467@linuxfoundation.org> References: <20240910092557.876094467@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jonathan Cameron [ Upstream commit fadf231f0a06a6748a7fc4a2c29ac9ef7bca6bfd ] Rafael observed [1] that returning 0 from processor_add() will result in acpi_default_enumeration() being called which will attempt to create a platform device, but that makes little sense when the processor is known to be not available. So just return the error code from acpi_processor_get_info() instead. Link: https://lore.kernel.org/all/CAJZ5v0iKU8ra9jR+EmgxbuNm=Uwx2m1-8vn_RAZ+aCiUVLe3Pw@mail.gmail.com/ [1] Suggested-by: Rafael J. Wysocki Acked-by: Rafael J. Wysocki Reviewed-by: Gavin Shan Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20240529133446.28446-5-Jonathan.Cameron@huawei.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- drivers/acpi/acpi_processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 6737b1cbf6d6..5662c157fda7 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -373,7 +373,7 @@ static int acpi_processor_add(struct acpi_device *device, result = acpi_processor_get_info(device); if (result) /* Processor is not physically present or unavailable */ - return 0; + return result; BUG_ON(pr->id >= nr_cpu_ids); -- 2.43.0