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 EB084127E18; Tue, 29 Apr 2025 17:07:46 +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=1745946467; cv=none; b=N8hWxifWo1mmTC8expqTqW1bipa8tydgWqwVoHiyuBL1Ki8h9LFN/sX7RA59pZQTljmZIs719M5PNuahkA5VINh4E2ceSvCb21fTAM8guKCmwcoaP73tH8tFySMeZX9nbRHbNCNk1b64VnnDCickrfYreaz7TPRnnBCUXLPB/Eo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745946467; c=relaxed/simple; bh=kHmHg+4vVLrrSB+z070fsXRbWxxtJOJ2uPOzmzKk0aY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ts/GGLhQFBH2aSEUVtKHwtHCQojs9LdoLPE/9dODSPUuKE+y47+TNvsBeQHRauEz4n8tKZZDvDRv02HxbgaT2OTP49chYlj9HPANgyTxvTKe8yQRGwyLshvfHt4AJ1HYD8JW2KjCWx4botFz0eR991e0kjiwnkjORZYjcZBJBRc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=i5r6K6+K; 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="i5r6K6+K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A05DC4CEE3; Tue, 29 Apr 2025 17:07:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745946466; bh=kHmHg+4vVLrrSB+z070fsXRbWxxtJOJ2uPOzmzKk0aY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i5r6K6+KbVe7UHOJ0PtKj9UjMNU98y4QaignNEs+sgk0s9U/+B8CgoHKkj2CxskK8 p0hJwkkEPrLwKVqa12JIORjIVTH3fIq2fT52hUpW3kcSlDUXlVSRBlvzGsrfoai+0r VuxcRTXVz72N59gT7Ul+nBXxsZ9lhTkm6y2PO8ys= 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.14 249/311] ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls Date: Tue, 29 Apr 2025 18:41:26 +0200 Message-ID: <20250429161131.225472126@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429161121.011111832@linuxfoundation.org> References: <20250429161121.011111832@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.14-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