libkmod: fix return error when opening index
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 10 Mar 2020 05:00:27 +0000 (22:00 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 23 Mar 2020 19:37:40 +0000 (12:37 -0700)
commit3bd7187ff549a2ef2441dcddabf382cc53cf6f22
tree8bd52c83782ec55450e2f5d682a0bdfed25f63ea
parent89443220e3943624eba8e2e960c13c124e2082b8
libkmod: fix return error when opening index

When calling kmod_load_resources() we could end up getting a bogus
return value -ENOMEM due to several other reasons, like the index not
existing. Change index_mm_open() to propagate the failure reason so we
can take actions on it or return to the caller.
libkmod/libkmod-index.c
libkmod/libkmod-index.h
libkmod/libkmod.c