modules: Skip empty sections when exporting section notes
commit8dfabfcf7b0c03f33f7cb945772027060de70b61
authorBen Hutchings <ben@decadent.org.uk>
Sat, 19 Dec 2009 14:43:01 +0000 (19 14:43 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 Jan 2010 18:19:14 +0000 (18 10:19 -0800)
tree5e6830aab1f3d504619f515fc385b355f86c9311
parentefd38f42843399cd8da8a5b63b04c8917f8d83a7
modules: Skip empty sections when exporting section notes

commit 10b465aaf9536ee5a16652fa0700740183d48ec9 upstream.

Commit 35dead4 "modules: don't export section names of empty sections
via sysfs" changed the set of sections that have attributes, but did
not change the iteration over these attributes in add_notes_attrs().
This can lead to add_notes_attrs() creating attributes with the wrong
names or with null name pointers.

Introduce a sect_empty() function and use it in both add_sect_attrs()
and add_notes_attrs().

Reported-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/module.c