Merge tag 'gcc-plugins-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / lib / earlycpio.c
index 3eb3e47..db283ba 100644 (file)
@@ -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",