Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a61b2dfd1823506dbf1f9b046e0b09237ec1b985
Commit:     a61b2dfd1823506dbf1f9b046e0b09237ec1b985
Parent:     9bf8cb9b7908383752b1842eae78269f7e16d9fb
Author:     Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 26 19:46:52 2007 +0100
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Wed May 2 20:58:07 2007 +0200

    kbuild: fix segmentation fault in modpost
    
    If modpost was called manually with filenames without '/'
    then modpost would segfault.
    
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
---
 scripts/mod/modpost.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index e1f2b31..281abb7 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1345,6 +1345,7 @@ static void add_depends(struct buffer *b, struct module 
*mod,
        buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
        buf_printf(b, "\"depends=");
        for (s = mod->unres; s; s = s->next) {
+               const char *p;
                if (!s->module)
                        continue;
 
@@ -1352,8 +1353,11 @@ static void add_depends(struct buffer *b, struct module 
*mod,
                        continue;
 
                s->module->seen = 1;
-               buf_printf(b, "%s%s", first ? "" : ",",
-                          strrchr(s->module->name, '/') + 1);
+               if ((p = strrchr(s->module->name, '/')) != NULL)
+                       p++;
+               else
+                       p = s->module->name;
+               buf_printf(b, "%s%s", first ? "" : ",", p);
                first = 0;
        }
        buf_printf(b, "\";\n");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to