aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Yingliang2022-02-23 16:49:54 +0800
committerJakub Kicinski2022-02-24 21:21:27 -0800
commit37f40f81e589839c17ed99a103bc1bc5f7343313 (patch)
tree0efb854c144c0e7371b38b61e4fd6325ddacc401
parentd434ee9dee6dc75984897f183df773427a68a1ff (diff)
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: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220223084954.1771075-2-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/marvell/prestera/prestera_router.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router.c b/drivers/net/ethernet/marvell/prestera/prestera_router.c
index 54ebda61bfea..6c5618cf4f08 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_router.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_router.c
@@ -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