]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
depmod: warn on invalid devname specification
authorTom Gundersen <teg@jklm.no>
Mon, 9 Sep 2013 18:01:01 +0000 (20:01 +0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 10 Sep 2013 03:49:41 +0000 (00:49 -0300)
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>
tools/depmod.c

index 58f0f584fa2ebd1c09e5f6280433ea4600696446..b1b58746be4a0dcdaf373e5d8bb4fad56f5b58b2 100644 (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);
                }
        }