]> git.ipfire.org Git - thirdparty/kmod.git/commit
test-initstate: Check for negative value on error
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 15 Feb 2022 22:05:13 +0000 (14:05 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 21 Feb 2022 04:58:11 +0000 (20:58 -0800)
commit9dc4e5ccd4d7ff9ed4e96db8446501a3dc862dbf
tree2790f0da0f98db11d92f9b7ca8bbb78cebbde4ce
parent0246e06340df292b5dda4bc00e24cc9ae894e881
test-initstate: Check for negative value on error

Documentation says kmod_module_new_from_lookup() returns < 0 on error
and 0 otherwise. There are bugs in libkmod however making it return
a positive value in some situations, that need to be fixed. However
it's best to check for the error explicitly like is done in the rest
of the library to avoid this kind of issues.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
testsuite/test-initstate.c