Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965068AbbEFAxG (ORCPT ); Tue, 5 May 2015 20:53:06 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:55404 "EHLO e23smtp06.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755751AbbEFAxC (ORCPT ); Tue, 5 May 2015 20:53:02 -0400 From: "Hon Ching(Vicky) Lo" To: tpmdd-devel@lists.sourceforge.net Cc: Peter Huewe , Ashley Lai , Mimi Zohar , Vicky Lo , linux-kernel@vger.kernel.org, "Hon Ching(Vicky) Lo" , Joy Latten Subject: [PATCH 1/3] vTPM: fixed the limit checking Date: Tue, 5 May 2015 20:51:24 -0400 Message-Id: <1430873486-25868-2-git-send-email-honclo@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1430873486-25868-1-git-send-email-honclo@linux.vnet.ibm.com> References: <1430873486-25868-1-git-send-email-honclo@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050600-0021-0000-0000-00000131EF82 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1153 Lines: 36 Do not skip the last entry of the event log. Signed-off-by: Hon Ching(Vicky) Lo Signed-off-by: Joy Latten Changelog: - remove redundant code --- drivers/char/tpm/tpm_eventlog.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c index 3a56a13..e77d8c1 100644 --- a/drivers/char/tpm/tpm_eventlog.c +++ b/drivers/char/tpm/tpm_eventlog.c @@ -116,11 +116,8 @@ static void *tpm_bios_measurements_next(struct seq_file *m, void *v, event = v; - if (event->event_type == 0 && event->event_size == 0) - return NULL; - if ((event->event_type == 0 && event->event_size == 0) || - ((v + sizeof(struct tcpa_event) + event->event_size) >= limit)) + ((v + sizeof(struct tcpa_event) + event->event_size) > limit)) return NULL; (*pos)++; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/