- kmod_module_symbols_free_list()
- kmod_module_dependency_symbols_free_list()
+* libkmod API breaking changes:
+ - dedicated error value for all kmod_*_get_crc() functions. Currently there
+ is no way for callers to distinguish between a valid CRC=0 and the error
+ code 0.
+
* index: drop the "open(), seek(), read()" implementation and use another one
with mmap(). When lookup() is called and the file is not mmaped, mmap it.
Another possibility is to drop the mmap implementation relying on VFS to have
{
struct kmod_module_version *version;
- if (entry == NULL)
+ if (entry == NULL || entry->data == NULL)
return NULL;
version = entry->data;
*
* Get the crc of a kmod module version.
*
- * Returns: the crc of this kmod module version on success or NULL on
- * failure. The string is owned by the version, do not free it.
+ * Returns: the crc of this kmod module version if available, otherwise default to 0.
*/
KMOD_EXPORT uint64_t kmod_module_version_get_crc(const struct kmod_list *entry)
{
struct kmod_module_version *version;
- if (entry == NULL)
+ if (entry == NULL || entry->data == NULL)
return 0;
version = entry->data;
{
struct kmod_module_symbol *symbol;
- if (entry == NULL)
+ if (entry == NULL || entry->data == NULL)
return NULL;
symbol = entry->data;
*
* Get the crc of a kmod module symbol.
*
- * Returns: the crc of this kmod module symbol on success or NULL on
- * failure. The string is owned by the symbol, do not free it.
+ * Returns: the crc of this kmod module symbol if available, otherwise default to 0.
*/
KMOD_EXPORT uint64_t kmod_module_symbol_get_crc(const struct kmod_list *entry)
{
struct kmod_module_symbol *symbol;
- if (entry == NULL)
+ if (entry == NULL || entry->data == NULL)
return 0;
symbol = entry->data;
{
struct kmod_module_dependency_symbol *dependency_symbol;
- if (entry == NULL)
+ if (entry == NULL || entry->data == NULL)
return NULL;
dependency_symbol = entry->data;
*
* Get the crc of a kmod module dependency_symbol.
*
- * Returns: the crc of this kmod module dependency_symbol on success or NULL on
- * failure. The string is owned by the dependency_symbol, do not free it.
+ * Returns: the crc of this kmod module dependency_symbol if available, otherwise default to 0.
*/
KMOD_EXPORT uint64_t kmod_module_dependency_symbol_get_crc(const struct kmod_list *entry)
{
struct kmod_module_dependency_symbol *dependency_symbol;
- if (entry == NULL)
+ if (entry == NULL || entry->data == NULL)
return 0;
dependency_symbol = entry->data;
{
struct kmod_module_dependency_symbol *dependency_symbol;
- if (entry == NULL)
+ if (entry == NULL || entry->data == NULL)
return 0;
dependency_symbol = entry->data;