]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: Propagate hash_add errors
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 15 Nov 2024 17:43:12 +0000 (18:43 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 21 Nov 2024 04:34:33 +0000 (22:34 -0600)
commit808eb4b8e9a17ea5e36d5c2865a3446077d499e8
treef1e43d432d8df94eb672eec9189ed6cdc6cfa358
parentc5c36b61da7e85e16e771ff09e62011225152a5d
libkmod: Propagate hash_add errors

If newly created module in kmod_module_new could not be added to hash,
return an error. Otherwise it is possible to create multiple independent
structs with the same name, which the hash set is supposed to prevent.

An error only occurs in out of memory conditions.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/248
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/libkmod-internal.h
libkmod/libkmod-module.c
libkmod/libkmod.c