libkmod-elf: Fix check by class in get_modversions()
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 7 Mar 2014 04:17:10 +0000 (01:17 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 7 Mar 2014 04:24:39 +0000 (01:24 -0300)
commitfea655dcb38b9b9cacfb52ed2da2445c204f8c7e
tree674331cb373398b21cc1581b657301a8f7ef6f77
parent632fb7b4634a540bb09af3b2004b3fe44cd4a214
libkmod-elf: Fix check by class in get_modversions()

Commit 51c409b ("Cache the offset of crc") unintentinally changed the
comparison "if (elf->class & KMOD_ELF_32)" to
"if (elf->class == KMOD_ELF_32)".

This has been reported by Serge Voilokov <serge0x76@gmail.com>:

On Raspberry PI elf->class equals KMOD_ELF_32|KMOD_ELF_LSB so
valid condition should be (elf->class & KMOD_ELF_32) instead of
(elf->class == KMOD_ELF_32).

This fixes "modprobe --dump-modversions" failing on 32b systems.
libkmod/libkmod-elf.c