Merge tag 'kbuild-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-block.git] / scripts / mod / modpost.c
index bf7c4b4b5ff45694322af0d6b221b6735ea1a739..6b37039c9e927bc3ffcad77b82e3e9f95d7bf0a7 100644 (file)
@@ -1050,7 +1050,9 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
        sec_mismatch_count++;
 
        warn("%s: section mismatch in reference: %s+0x%x (section: %s) -> %s (section: %s)\n",
-            modname, fromsym, (unsigned int)(faddr - from->st_value), fromsec, tosym, tosec);
+            modname, fromsym,
+            (unsigned int)(faddr - (from ? from->st_value : 0)),
+            fromsec, tosym, tosec);
 
        if (mismatch->mismatch == EXTABLE_TO_NON_TEXT) {
                if (match(tosec, mismatch->bad_tosec))