diff options
author | Borislav Petkov <bp@suse.de> | 2016-06-06 11:10:44 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-06-08 05:04:19 -0400 |
commit | 7557933e6b99d381c19b196901ed537b00f6d121 (patch) | |
tree | ad44428540f33df71b41daa475423f99685e3586 /lib/earlycpio.c | |
parent | 4b703305d98bf7350d4b2953ee39a3aa2eeb1778 (diff) |
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@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1465225850-7352-4-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/earlycpio.c')
-rw-r--r-- | lib/earlycpio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/earlycpio.c b/lib/earlycpio.c index 3eb3e4722b8e..db283ba4d2c1 100644 --- a/lib/earlycpio.c +++ b/lib/earlycpio.c | |||
@@ -125,7 +125,10 @@ struct cpio_data find_cpio_data(const char *path, void *data, | |||
125 | if ((ch[C_MODE] & 0170000) == 0100000 && | 125 | if ((ch[C_MODE] & 0170000) == 0100000 && |
126 | ch[C_NAMESIZE] >= mypathsize && | 126 | ch[C_NAMESIZE] >= mypathsize && |
127 | !memcmp(p, path, mypathsize)) { | 127 | !memcmp(p, path, mypathsize)) { |
128 | *nextoff = (long)nptr - (long)data; | 128 | |
129 | if (nextoff) | ||
130 | *nextoff = (long)nptr - (long)data; | ||
131 | |||
129 | if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) { | 132 | if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) { |
130 | pr_warn( | 133 | pr_warn( |
131 | "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n", | 134 | "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n", |