mirror of
https://gitee.com/openharmony/third_party_libnl
synced 2024-11-28 04:30:23 +00:00
cache: assert in nl_cache_mngt_register() for valid oo_keygen() function
oo_keygen() requires oo_compare(). Assert in nl_cache_mngt_register(). http://lists.infradead.org/pipermail/libnl/2014-November/001759.html Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
60ad8251f8
commit
77771ba26f
@ -254,6 +254,9 @@ int nl_cache_mngt_register(struct nl_cache_ops *ops)
|
||||
if (!ops->co_name || !ops->co_obj_ops)
|
||||
return -NLE_INVAL;
|
||||
|
||||
/* oo_keygen() also needs oo_compare() */
|
||||
BUG_ON (ops->co_obj_ops->oo_keygen && !ops->co_obj_ops->oo_compare);
|
||||
|
||||
nl_write_lock(&cache_ops_lock);
|
||||
if (__nl_cache_ops_lookup(ops->co_name)) {
|
||||
nl_write_unlock(&cache_ops_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user