[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220223084954.1771075-2-yangyingliang@huawei.com>
Date: Wed, 23 Feb 2022 16:49:54 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>
CC: <kuba@...nel.org>, <davem@...emloft.net>, <tchornyi@...vell.com>,
<yevhen.orlov@...ision.eu>
Subject: [PATCH net-next 2/2] 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().
Fixes: 4394fbcb78cf ("net: marvell: prestera: handle fib notifications")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
drivers/net/ethernet/marvell/prestera/prestera_router.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
--
2.25.1
Powered by blists - more mailing lists