Skip to content
Commit 10b465aa authored by Ben Hutchings's avatar Ben Hutchings Committed by Linus Torvalds
Browse files

modules: Skip empty sections when exporting section notes

Commit 35dead42

 "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: default avatarMartin Michlmayr <tbm@cyrius.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Tested-by: default avatarMartin Michlmayr <tbm@cyrius.com>
Cc: stable@kernel.org
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 74d2e4f8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment