mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 20:33:49 -04:00
net: marvell: prestera: Fix return value check in prestera_fib_node_find()
rhashtable_lookup_fast() returns NULL pointer not ERR_PTR(), so it can return fib_node directly in prestera_fib_node_find(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220223084954.1771075-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
06388a03d2
commit
d434ee9dee
@@ -239,7 +239,7 @@ prestera_fib_node_find(struct prestera_switch *sw, struct prestera_fib_key *key)
|
||||
|
||||
fib_node = rhashtable_lookup_fast(&sw->router->fib_ht, key,
|
||||
__prestera_fib_ht_params);
|
||||
return IS_ERR(fib_node) ? NULL : fib_node;
|
||||
return fib_node;
|
||||
}
|
||||
|
||||
static void __prestera_fib_node_destruct(struct prestera_switch *sw,
|
||||
|
||||
Reference in New Issue
Block a user