From e2a23d8b44924d80e8d4bd34e2d582f01bd1652c Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Thu, 3 Dec 2009 00:29:15 +0100 Subject: [PATCH] --- yaml --- r: 169073 b: refs/heads/master c: 35dead4235e2b67da7275b4122fed37099c2f462 h: refs/heads/master i: 169071: e4c983657ba142416557def90a678880bd15ca63 v: v3 --- [refs] | 2 +- trunk/kernel/module.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index d800a352e0fa..507bea0ddc89 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ebd65a5855a1ddb21706e630c9ba1b9e80c767f7 +refs/heads/master: 35dead4235e2b67da7275b4122fed37099c2f462 diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c index 8b7d8805819d..5842a71cf052 100644 --- a/trunk/kernel/module.c +++ b/trunk/kernel/module.c @@ -1187,7 +1187,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect, /* Count loaded sections and allocate structures */ for (i = 0; i < nsect; i++) - if (sechdrs[i].sh_flags & SHF_ALLOC) + if (sechdrs[i].sh_flags & SHF_ALLOC + && sechdrs[i].sh_size) nloaded++; size[0] = ALIGN(sizeof(*sect_attrs) + nloaded * sizeof(sect_attrs->attrs[0]), @@ -1207,6 +1208,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect, for (i = 0; i < nsect; i++) { if (! (sechdrs[i].sh_flags & SHF_ALLOC)) continue; + if (!sechdrs[i].sh_size) + continue; sattr->address = sechdrs[i].sh_addr; sattr->name = kstrdup(secstrings + sechdrs[i].sh_name, GFP_KERNEL);