mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Gundersen <teg@jklm.no>
To: linux-modules@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Tom Gundersen <teg@jklm.no>,
	Kay Sievers <kay@vrfy.org>,
	Lucas De Marchi <lucas.demarchi@profusion.mobi>
Subject: [PATCH] depmod: warn on invalid devname specification
Date: Mon,  9 Sep 2013 20:01:01 +0200	[thread overview]
Message-ID: <1378749661-8841-1-git-send-email-teg@jklm.no> (raw)

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 | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/depmod.c b/tools/depmod.c
index 985cf3a..5855b2a 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -2120,11 +2120,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);
 		}
 	}
 
-- 
1.8.4


             reply	other threads:[~2013-09-09 18:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 18:01 Tom Gundersen [this message]
2013-09-10  3:55 ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378749661-8841-1-git-send-email-teg@jklm.no \
    --to=teg@jklm.no \
    --cc=kay@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®