From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030879AbbD1Sll (ORCPT ); Tue, 28 Apr 2015 14:41:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38454 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030569AbbD1Slk (ORCPT ); Tue, 28 Apr 2015 14:41:40 -0400 Date: Tue, 28 Apr 2015 20:41:35 +0200 From: Jean Delvare To: LKML Cc: Leif Lindholm , Matt Fleming , Ard Biesheuvel , Ivan Khoronzhuk Subject: [PATCH] firmware: dmi_scan: Only honor end-of-table for 64-bit tables Message-ID: <20150428204135.11ab70ce@endymion.delvare> Organization: SUSE Linux X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.23; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jean Delvare Subject: firmware: dmi_scan: Only honor end-of-table for 64-bit tables A 32-bit entry point to a DMI table says how many structures the table contains. The SMBIOS specification explicitly says that end-of-table markers should be ignored if they are not actually at the end of the DMI table. So only honor the end-of-table marker for tables accessed through 64-bit entry points, as they do not specify a structure count. Fixes: fc43026278 ("dmi: add support for SMBIOS 3.0 64-bit entry point") Signed-off-by: Jean Delvare Cc: Leif Lindholm Cc: Matt Fleming Cc: Ard Biesheuvel --- drivers/firmware/dmi_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-4.1-rc1.orig/drivers/firmware/dmi_scan.c 2015-04-28 16:39:00.845282262 +0200 +++ linux-4.1-rc1/drivers/firmware/dmi_scan.c 2015-04-28 16:47:35.092644748 +0200 @@ -111,7 +111,7 @@ static void dmi_table(u8 *buf, /* * 7.45 End-of-Table (Type 127) [SMBIOS reference spec v3.0.0] */ - if (dm->type == DMI_ENTRY_END_OF_TABLE) + if (!dmi_num && dm->type == DMI_ENTRY_END_OF_TABLE) break; data += 2; -- Jean Delvare SUSE L3 Support