diff mbox

regression: crash from 'ls /sys/modules/wl1251_spi/notes'

Message ID 87k4w4wux9.fsf@purkki.valot.fi (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Kalle Valo Dec. 30, 2009, 11:41 a.m. UTC
None
diff mbox

Patch

--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1189,10 +1189,13 @@  static void add_notes_attrs(struct module
*mod, unsigned int nsect,
        if (!notes_attrs->dir)
                goto out;
 
-       for (i = 0; i < notes; ++i)
+       for (i = 0; i < notes; ++i) {
+               if (WARN_ON(!notes_attrs->attrs[i].attr.name))
+                       continue;
                if (sysfs_create_bin_file(notes_attrs->dir,
                                          &notes_attrs->attrs[i]))
                        goto out;
+       }
 
        mod->notes_attrs = notes_attrs;