From patchwork Wed Feb 11 09:46:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 44571 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 847BD2151F for ; Wed, 11 Feb 2015 09:47:10 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id z11sf1470236lbi.2 for ; Wed, 11 Feb 2015 01:47:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=dAS//mh9RJfdux9shLdXtjj2ybP9a5HQrdy1RhCUJJ0=; b=mrwMCi+VYBql8CeYojF/IFjZjJUhZuhhPWOJq8JXJzESXC84pIgBzZ1azdnvl5PweA 4QE7aWwoO8gKPZB4ehHqwJOTV8zJmrNZIC7bDZMLERppx0K9QI9qRx/2oyrSn6K5SpRU U3oYrSTbJ2QV868m8L02Rm39VIeI0yPT7aOudGK9yv8adY6gQmfY7fmQEuQO6g7AuMzH b7Fv7osyE1m8/I6CbuZRE4oyZYlJqfiglF1CuqCXG19Tu9rbyDSZQzNO784SEqXbrfYe bN4KRjZJ02OiHN+F6qjnD1Z0+HKSeQi/Is1laHAbPFuyjVtYS0cz71Kd2zPd/boF6RYe +beg== X-Gm-Message-State: ALoCoQnlHe0/XNtLz7M2rG47IOFTKylfSAWGFcAOeTEHw2viuUaWE5od606JVr4PvvxMb0m6LH3e X-Received: by 10.112.35.135 with SMTP id h7mr3321285lbj.23.1423648029517; Wed, 11 Feb 2015 01:47:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.71 with SMTP id k7ls40533laf.9.gmail; Wed, 11 Feb 2015 01:47:09 -0800 (PST) X-Received: by 10.152.207.11 with SMTP id ls11mr26979911lac.83.1423648029253; Wed, 11 Feb 2015 01:47:09 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id q5si155060lbf.117.2015.02.11.01.47.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 01:47:08 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labgq15 with SMTP id gq15so2204150lab.6 for ; Wed, 11 Feb 2015 01:47:08 -0800 (PST) X-Received: by 10.112.114.230 with SMTP id jj6mr26634732lbb.112.1423648028655; Wed, 11 Feb 2015 01:47:08 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1141313lbj; Wed, 11 Feb 2015 01:47:07 -0800 (PST) X-Received: by 10.68.239.69 with SMTP id vq5mr44737505pbc.96.1423648026249; Wed, 11 Feb 2015 01:47:06 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bn9si266687pdb.117.2015.02.11.01.47.05; Wed, 11 Feb 2015 01:47:06 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752718AbbBKJqy (ORCPT + 28 others); Wed, 11 Feb 2015 04:46:54 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:48341 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752681AbbBKJqu (ORCPT ); Wed, 11 Feb 2015 04:46:50 -0500 Received: by mail-pa0-f52.google.com with SMTP id ey11so2885912pad.11 for ; Wed, 11 Feb 2015 01:46:49 -0800 (PST) X-Received: by 10.70.129.168 with SMTP id nx8mr20526978pdb.124.1423648009339; Wed, 11 Feb 2015 01:46:49 -0800 (PST) Received: from khorivan.itg.ti.com ([210.177.145.249]) by mx.google.com with ESMTPSA id c9sm360560pdm.51.2015.02.11.01.46.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Feb 2015 01:46:48 -0800 (PST) From: Ivan Khoronzhuk To: matt.fleming@intel.com, ard.biesheuvel@linaro.org Cc: leif.lindholm@linaro.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [Patch 2/3] firmware: dmi_scan: fix dmi_len type Date: Wed, 11 Feb 2015 11:46:31 +0200 Message-Id: <1423647992-3787-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423647992-3787-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1423647992-3787-1-git-send-email-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , According to SMBIOSv3 specification the length of DMI table can be up to 32bits wide. So use appropriate type to avoid overflow. It's obvious that dmi_num theoretically can be more than u16 also, so it's can be changed to u32 or at least it's better to use int instead of u16, but on that moment I cannot imagine dmi structure count more than 65535 and it can require changing type of vars that work with it. So I didn't correct it. Signed-off-by: Ivan Khoronzhuk Acked-by: Ard Biesheuvel --- drivers/firmware/dmi_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index fb16203..952e95c 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -18,7 +18,7 @@ static const char dmi_empty_string[] = " "; static u16 __initdata dmi_ver; -static u16 dmi_len; +static u32 dmi_len; static u16 dmi_num; /* * Catch too early calls to dmi_check_system():