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 0ED3E2741AC; Mon, 14 Apr 2025 13:26:36 +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=1744637196; cv=none; b=FTCoEu9riS6auR7IGun1xKph/aATfBcru8zTxde/Q3nkFMBJ2HVa97mt1PZUVVs5Y2PV6a+Xewkf/DftVIPgyzrvItco7J+4uAM0Z/OSMrl9wmtsOssTMunc4aDhrAFebbF+OwOKAoOWHLlKRsjxCtJvlgguggAd4GONn8etNL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744637196; c=relaxed/simple; bh=AwcB7sgJ2b3w3rrwnUM1rfisGcuuzSfBoHqPMRdTGF0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=n9W4FrGdQUGGVsOv/zdS1TuZxaw4ZdbePLLJVUoSQ4BZx06/IRIcdXKEuJwWTAaSgId184RMNYsBeqxqLGcXhZ+kxs1A6mKYiP4Joe8rrokEb54NjrBtGtuKnJX4e8Xq5WfneFVLTJJYscgk0nEw/0GYQUDAxwaHKvY+UxKcqU0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N7EId0r6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N7EId0r6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8D5BC4CEEB; Mon, 14 Apr 2025 13:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744637195; bh=AwcB7sgJ2b3w3rrwnUM1rfisGcuuzSfBoHqPMRdTGF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N7EId0r6sREZyNoe69fTITl098ukwobU7awCL4b3OEaVAFY42naO/xc6iXLIFFYIk /VNUy3eXXKjyYam5UBG5Oz/sRF7I8xuLU3qqzwuiGXZfB2hWMsQ1lzh53oKWJzwEtS ne+/gCALsthFJGSA/IdgtHwxaKYQUUtTr7EBKW2xHAXJTFy5dnSngVFvn3UYz42ZsW iFv4r7fYTfheBJ2OnWDc6HZifFiliK0GU3ZAowWxrSOs6B3dwuwpWeLFAsJLNiZ5Pn bk0P+mIlMRIkkdExHMeAz4h0QEDfSoPA7pEEihfTYjYOkiP38FosnKaVChgkSIPPbK iAUKX3VK3t+Xw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jean-Marc Eurin , "Rafael J . Wysocki" , Sasha Levin , rafael@kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH AUTOSEL 6.14 12/34] ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls Date: Mon, 14 Apr 2025 09:25:48 -0400 Message-Id: <20250414132610.677644-12-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250414132610.677644-1-sashal@kernel.org> References: <20250414132610.677644-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.14.2 Content-Transfer-Encoding: 8bit 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