depmod: warn on invalid devname specification

During the last merge window (3.12) a couple of modules gained devname
aliases, but without the necessary major and minor information. These were
then silently ignored when generating modules.devname.

Complain loudly to avoid such errors sneaking in undetected in the future:

    depmod: ERROR: Module 'zram' has devname (zram) but lacks major and minor information. Ignoring.
    depmod: ERROR: Module 'uhid' has devname (uhid) but lacks major and minor information. Ignoring.

Cc: Kay Sievers <kay@vrfy.org>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
This commit is contained in:
Tom Gundersen 2013-09-09 20:01:01 +02:00 committed by Lucas De Marchi
parent 4c2dc16a2e
commit 6506ddf5a3

View File

@ -2112,11 +2112,18 @@ static int output_devname(struct depmod *depmod, FILE *out)
minor = min;
}
if (type != '\0' && devname != NULL) {
if (type != '\0' && devname != NULL)
break;
}
if (devname != NULL) {
if (type != '\0')
fprintf(out, "%s %s %c%u:%u\n", mod->modname,
devname, type, major, minor);
break;
}
else
ERR("Module '%s' has devname (%s) but "
"lacks major and minor information. "
"Ignoring.\n", mod->modname, devname);
}
}