Commit 37f40f81 authored by Yang Yingliang's avatar Yang Yingliang Committed by Jakub Kicinski

net: marvell: prestera: Fix return value check in prestera_kern_fib_cache_find()

rhashtable_lookup_fast() returns NULL pointer not ERR_PTR(), so
it can return fib_node directly in prestera_kern_fib_cache_find().
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220223084954.1771075-2-yangyingliang@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d434ee9d
......@@ -68,7 +68,7 @@ prestera_kern_fib_cache_find(struct prestera_switch *sw,
fib_cache =
rhashtable_lookup_fast(&sw->router->kern_fib_cache_ht, key,
__prestera_kern_fib_cache_ht_params);
return IS_ERR(fib_cache) ? NULL : fib_cache;
return fib_cache;
}
static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment