From: Tom Gundersen Date: Mon, 9 Sep 2013 18:01:01 +0000 (+0200) Subject: depmod: warn on invalid devname specification X-Git-Tag: v16~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6506ddf5a37849049509324eeff72697f94584e3;p=thirdparty%2Fkmod.git 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 Cc: Lucas De Marchi --- diff --git a/tools/depmod.c b/tools/depmod.c index 58f0f584..b1b58746 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -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); } }