Skip to content

Commit cbc3d00

Browse files
Mauricio Faria de Oliveiramasahir0y
authored andcommitted
modpost: add missing else to the "of" check
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: acbef7b ("modpost: fix module autoloading for OF devices with generic compatible property") Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 28d49e1 commit cbc3d00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/mod/file2alias.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
16041604
/* First handle the "special" cases */
16051605
if (sym_is(name, namelen, "usb"))
16061606
do_usb_table(symval, sym->st_size, mod);
1607-
if (sym_is(name, namelen, "of"))
1607+
else if (sym_is(name, namelen, "of"))
16081608
do_of_table(symval, sym->st_size, mod);
16091609
else if (sym_is(name, namelen, "pnp"))
16101610
do_pnp_device_entry(symval, sym->st_size, mod);

0 commit comments

Comments
 (0)