Subject: Re: linux-next: build failure after merge of the final tree

From: Andrew Morton <[email-masked]>
Date: Tue, 10 Aug 2010 22:23:10 -0700

On Wed, 11 Aug 2010 13:38:12 +1000 Stephen Rothwell <[email-masked]> wrote:

> The only patch new to linux-next since yesterday that affects scripts/mod
> is commit 37ed19d5cce35a40d3913cf9aa208ce9f60db3d7
> ("scripts/mod/modpost.c: fix memory leak") from Linus' tree.
> 
> I have reverted that commit in linux-next for today as that makes the
> error go away.

doh.  This?

From: Andrew Morton <[email-masked]>

- don't kfree("")

- fix one missed conversion

Reported-by: Stephen Rothwell <[email-masked]>
Cc: Alexey Fomenko <[email-masked]>
Cc: Trevor Keith <[email-masked]>
Cc: Rusty Russell <[email-masked]>
Cc: Michal Marek <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
---

 scripts/mod/modpost.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff -puN scripts/mod/modpost.c~d scripts/mod/modpost.c
--- a/scripts/mod/modpost.c~d
+++ a/scripts/mod/modpost.c
@@ -14,6 +14,7 @@
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <ctype.h>
+#include <string.h>
 #include "modpost.h"
 #include "../../include/generated/autoconf.h"
 #include "../../include/linux/license.h"
@@ -1167,7 +1168,7 @@ static char *sec2annotation(const char *
 			strcat(p, " ");
 		return r; /* we leak her but we do not care */
 	} else {
-		return "";
+		return strdup("");
 	}
 }
 
@@ -1302,7 +1303,7 @@ static void report_sec_mismatch(const ch
 		"%s%s so it may be used outside an exit section.\n",
 		from, prl_from, fromsym, from_p,
 		to, prl_to, tosym, to_p,
-		sec2annotation(tosec), tosym, to_p);
+		prl_to, tosym, to_p);
 		free(prl_from);
 		free(prl_to);
 		break;
_