[PATCH] modpost, tpm_tis: Remove wildcard ACPI and PNP aliases

From: Ben Hutchings
Date: Tue Aug 13 2013 - 16:15:31 EST


tpm_tis has a 'spare' entry in its device ID table for adding
user-specified device IDs. This will be ignored by the driver
matching logic, but modpost turns it into:

alias: acpi*::*
alias: pnp:d*

This seems to result in the driver being loaded on almost all PCs.
Change do_pnp_device_entry() to stop if it finds such an entry,
similarly to do_usb_entry_multi().

Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
scripts/mod/file2alias.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 2370863..7dc7edf 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -535,6 +535,14 @@ static void do_pnp_device_entry(void *symval, unsigned long size,
char acpi_id[sizeof(*id)];
int j;

+ /*
+ * Some modules (tpm_tis) have empty slots as
+ * placeholder for run-time specification that results
+ * in catch-all alias
+ */
+ if (!**id)
+ return;
+
buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"pnp:d%s*\");\n", *id);



Attachment: signature.asc
Description: This is a digitally signed message part