Patch "modpost: add missing else to the "of" check" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    modpost: add missing else to the "of" check

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     modpost-add-missing-else-to-the-of-check.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit dfc2181217875c5de45b796879c08632a2695e8a
Author: Mauricio Faria de Oliveira <mfo@xxxxxxxxxxxxx>
Date:   Thu Sep 28 17:28:07 2023 -0300

    modpost: add missing else to the "of" check
    
    [ Upstream commit cbc3d00cf88fda95dbcafee3b38655b7a8f2650a ]
    
    Without this 'else' statement, an "usb" name goes into two handlers:
    the first/previous 'if' statement _AND_ the for-loop over 'devtable',
    but the latter is useless as it has no 'usb' device_id entry anyway.
    
    Tested with allmodconfig before/after patch; no changes to *.mod.c:
    
        git checkout v6.6-rc3
        make -j$(nproc) allmodconfig
        make -j$(nproc) olddefconfig
    
        make -j$(nproc)
        find . -name '*.mod.c' | cpio -pd /tmp/before
    
        # apply patch
    
        make -j$(nproc)
        find . -name '*.mod.c' | cpio -pd /tmp/after
    
        diff -r /tmp/before/ /tmp/after/
        # no difference
    
    Fixes: acbef7b76629 ("modpost: fix module autoloading for OF devices with generic compatible property")
    Signed-off-by: Mauricio Faria de Oliveira <mfo@xxxxxxxxxxxxx>
    Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 7f40b6aab689b..90868df7865e3 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1395,7 +1395,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
 	/* First handle the "special" cases */
 	if (sym_is(name, namelen, "usb"))
 		do_usb_table(symval, sym->st_size, mod);
-	if (sym_is(name, namelen, "of"))
+	else if (sym_is(name, namelen, "of"))
 		do_of_table(symval, sym->st_size, mod);
 	else if (sym_is(name, namelen, "pnp"))
 		do_pnp_device_entry(symval, sym->st_size, mod);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux