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 921C5240611; Tue, 29 Apr 2025 18:18:25 +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=1745950705; cv=none; b=fDjdkobcBmCF99Kc5yLL1NLFh4gz9/RjuI4MiMEcwNscm+rFgMiDzm47W2cGAMJco+cxJ1Pfg8F0i4wXYf6Rawwg/JdYhqryqkr8DP0S3/CsYW4+yK0sjUfZlZIYBksohskXPjaNrL2ChYw9OPq5XSahkmGcTC4x55IisG5VV8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745950705; c=relaxed/simple; bh=UIlUIrj5VmW6z1dIDPI5xvLDYoY02638FQEKZSlHtxs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FROwwQFfZaC7Y1qXjIu/XLiOTmDCBodxfgN5ggNrDM8JPsanx+9jmcXC5i1NjOcflfdGxOUEMJjh154K2qCJAglX+J5MAy7Pbq5UEYgY0qv0kPVa13XZh7JtM9qUgApJqrtGB33QwIuzeUWCsYQwhzCBS62RAopInLlpLBPMUN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Su9+Pa1A; 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="Su9+Pa1A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11E20C4CEE3; Tue, 29 Apr 2025 18:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745950705; bh=UIlUIrj5VmW6z1dIDPI5xvLDYoY02638FQEKZSlHtxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Su9+Pa1AXXIiXclCsjC8c+DRXa20GS71DXksVc28enAkDvlHYSpTJ6Ph8ONBgHawd 1q52a024e7gUhg3hxTlU3e9l1WLD9DdJG1p6gq4CBvr/SnRRTRqMOSpbUvuwsqD85i H7HyVDWCdPjosjGNhsVWAKeWQKS6EnVDXsEqfr9U= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jean-Marc Eurin , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.6 161/204] ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls Date: Tue, 29 Apr 2025 18:44:09 +0200 Message-ID: <20250429161106.000787194@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429161059.396852607@linuxfoundation.org> References: <20250429161059.396852607@linuxfoundation.org> User-Agent: quilt/0.68 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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jean-Marc Eurin [ Upstream commit 7ab4f0e37a0f4207e742a8de69be03984db6ebf0 ] The end of table checks should be done with the structure size, but 2 of the 3 similar calls use the pointer size. Signed-off-by: Jean-Marc Eurin Link: https://patch.msgid.link/20250402001542.2600671-1-jmeurin@google.com [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/pptt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index a35dd0e41c270..f73ce6e13065d 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -229,7 +229,7 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr, node_entry = ACPI_PTR_DIFF(node, table_hdr); entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr, sizeof(struct acpi_table_pptt)); - proc_sz = sizeof(struct acpi_pptt_processor *); + proc_sz = sizeof(struct acpi_pptt_processor); while ((unsigned long)entry + proc_sz < table_end) { cpu_node = (struct acpi_pptt_processor *)entry; @@ -270,7 +270,7 @@ static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he table_end = (unsigned long)table_hdr + table_hdr->length; entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr, sizeof(struct acpi_table_pptt)); - proc_sz = sizeof(struct acpi_pptt_processor *); + proc_sz = sizeof(struct acpi_pptt_processor); /* find the processor structure associated with this cpuid */ while ((unsigned long)entry + proc_sz < table_end) { -- 2.39.5