[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-7557933e6b99d381c19b196901ed537b00f6d121@git.kernel.org>
Date: Wed, 8 Jun 2016 02:52:52 -0700
From: tip-bot for Borislav Petkov <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, brgerst@...il.com,
peterz@...radead.org, mingo@...nel.org,
torvalds@...ux-foundation.org, bp@...e.de, bp@...en8.de,
dvlasenk@...hat.com, tglx@...utronix.de, luto@...capital.net
Subject: [tip:x86/microcode] lib/cpio: Make find_cpio_data()'s offset arg
optional
Commit-ID: 7557933e6b99d381c19b196901ed537b00f6d121
Gitweb: http://git.kernel.org/tip/7557933e6b99d381c19b196901ed537b00f6d121
Author: Borislav Petkov <bp@...e.de>
AuthorDate: Mon, 6 Jun 2016 17:10:44 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 8 Jun 2016 11:04:19 +0200
lib/cpio: Make find_cpio_data()'s offset arg optional
Some callers don't use it so make it optional.
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/1465225850-7352-4-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
lib/earlycpio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/earlycpio.c b/lib/earlycpio.c
index 3eb3e47..db283ba 100644
--- a/lib/earlycpio.c
+++ b/lib/earlycpio.c
@@ -125,7 +125,10 @@ struct cpio_data find_cpio_data(const char *path, void *data,
if ((ch[C_MODE] & 0170000) == 0100000 &&
ch[C_NAMESIZE] >= mypathsize &&
!memcmp(p, path, mypathsize)) {
- *nextoff = (long)nptr - (long)data;
+
+ if (nextoff)
+ *nextoff = (long)nptr - (long)data;
+
if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
pr_warn(
"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
Powered by blists - more mailing lists