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 DD30E2512E8; Tue, 29 Apr 2025 17:23:16 +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=1745947397; cv=none; b=ZdIy+XBMv8hLsjdyUHHuyKIqH85QXMDq2wKUHDn5gOZjUWQEsqNUQsdFlQ7A1HKLBKcNx0VIQLY01dzS951RM6+luUpeHSTJ4pIVFbBuaj4iQTdDfSDNPabBaukdlDNCfk1nkPmhV9D3Lb3D2uB3GmSS7WFK/apSlC00hpcRMu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745947397; c=relaxed/simple; bh=71WXt4rDMILQ1w5XbqnHx5JJlzljTq2ccsmVUWzeHk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DN8t84tMoADhrzwOUeCksVnDmiPqPJ5/LynThBGBrBvTPDunYuYqN9xI+EyBZSxS43C3aA3o2gg8zWp9FzaZ+SInxjwt031jYHwUyCh020beKnmG8X0SUDgv7+Sa+zHJoMbY3giqvsZ3vOKaJM40g7D3jzc6xASUMwAtlenNyw4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=07LOrLeZ; 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="07LOrLeZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C406C4CEEF; Tue, 29 Apr 2025 17:23:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745947396; bh=71WXt4rDMILQ1w5XbqnHx5JJlzljTq2ccsmVUWzeHk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=07LOrLeZrST0aqTU0EekmK0l9a1SGqBVV5ULSIHeU2LTrvqddhSR8pO9Dyv0WweDi EBidUcfY6mo/zWg866Iqvh+w9ZuAjSeuUgMYv6iJTsL5hkQ4kkDdxoG5l+GbixlLRM KlHcdMYF3hiLpbxjayFZo8myk2xHgas8udv1aRBM= 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 5.10 268/286] ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls Date: Tue, 29 Apr 2025 18:42:52 +0200 Message-ID: <20250429161118.946032354@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429161107.848008295@linuxfoundation.org> References: <20250429161107.848008295@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 5.10-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 4ae93350b70de..38581001811b4 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -217,7 +217,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; @@ -258,7 +258,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