kbuild: fix NULL dereference in scripts/mod/modpost.c
authorEric Sesterhenn <snakebyte@gmx.de>
Mon, 10 Apr 2006 22:54:16 +0000 (00:54 +0200)
committerSam Ravnborg <sam@mars.ravnborg.org>
Tue, 11 Apr 2006 11:37:07 +0000 (13:37 +0200)
before is NULL in this case, concluding from the surrounding code
it seems that after is the right one to use.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
scripts/mod/modpost.c

index 0b92ddf..7e8079a 100644 (file)
@@ -658,7 +658,7 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec,
                warn("%s - Section mismatch: reference to %s:%s from %s "
                     "before '%s' (at offset -0x%llx)\n",
                     modname, secname, refsymname, fromsec,
                warn("%s - Section mismatch: reference to %s:%s from %s "
                     "before '%s' (at offset -0x%llx)\n",
                     modname, secname, refsymname, fromsec,
-                    elf->strtab + before->st_name,
+                    elf->strtab + after->st_name,
                     (long long)r.r_offset);
        } else {
                warn("%s - Section mismatch: reference to %s:%s from %s "
                     (long long)r.r_offset);
        } else {
                warn("%s - Section mismatch: reference to %s:%s from %s "