]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
of: fix autoloading due to broken modalias with no 'compatible'
authorWolfram Sang <wsa@the-dreams.de>
Mon, 6 Jun 2016 16:48:38 +0000 (18:48 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 9 Aug 2016 13:07:56 +0000 (15:07 +0200)
BugLink: http://bugs.launchpad.net/bugs/1607404
commit b3c0a4dab7e35a9b6d69c0415641d2280fdefb2b upstream.

Because of an improper dereference, a stray 'C' character was output to
the modalias when no 'compatible' was specified. This is the case for
some old PowerMac drivers which only set the 'name' property. Fix it to
let them match again.

Reported-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Tested-by: Mathieu Malaterre <malat@debian.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Fixes: 6543becf26fff6 ("mod/file2alias: make modalias generation safe for cross compiling")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
scripts/mod/file2alias.c

index 8adca44061980ed529c9a2c4141960042f2ced22..8e8c69bee78f765e4692e6bb4f945fa4b7acb431 100644 (file)
@@ -695,7 +695,7 @@ static int do_of_entry (const char *filename, void *symval, char *alias)
        len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
                      (*type)[0] ? *type : "*");
 
-       if (compatible[0])
+       if ((*compatible)[0])
                sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
                        *compatible);