From d434ee9dee6dc75984897f183df773427a68a1ff Mon Sep 17 00:00:00 2001 From: Yang Yingliang Date: Wed, 23 Feb 2022 16:49:53 +0800 Subject: [PATCH] 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 Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220223084954.1771075-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/marvell/prestera/prestera_router_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c index d62adb9..5b0cf3b 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c @@ -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, -- 2.7.4