Commit 7557933e authored by Borislav Petkov's avatar Borislav Petkov Committed by Ingo Molnar

lib/cpio: Make find_cpio_data()'s offset arg optional

Some callers don't use it so make it optional.
Signed-off-by: default avatarBorislav 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.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 4b703305
...@@ -125,7 +125,10 @@ struct cpio_data find_cpio_data(const char *path, void *data, ...@@ -125,7 +125,10 @@ struct cpio_data find_cpio_data(const char *path, void *data,
if ((ch[C_MODE] & 0170000) == 0100000 && if ((ch[C_MODE] & 0170000) == 0100000 &&
ch[C_NAMESIZE] >= mypathsize && ch[C_NAMESIZE] >= mypathsize &&
!memcmp(p, path, mypathsize)) { !memcmp(p, path, mypathsize)) {
if (nextoff)
*nextoff = (long)nptr - (long)data; *nextoff = (long)nptr - (long)data;
if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) { if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
pr_warn( pr_warn(
"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n", "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment