Skip to contentSkip to conversation

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

PATCH Applied Yang Yingliang 2 participants 3 messages Feb 23, 2022 – Feb 25, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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().

Fixes 16de3db1208a ("net: marvell: prestera: add hardware router objects accounting for lpm")
---
 drivers/net/ethernet/marvell/prestera/prestera_router_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/prestera/prestera_router_hw.c +1 -1
index d62adb970dd5..5b0cf3be9a9e 100644
@@ -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,
Signature · 1 line
2.25.1
#1 lore raw

PATCH 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")
---
 drivers/net/ethernet/marvell/prestera/prestera_router.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/prestera/prestera_router.c +1 -1
index 54ebda61bfea..6c5618cf4f08 100644
@@ -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
Signature · 1 line
2.25.1
#2 lore raw
In reply to Yang Yingliang
This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 23 Feb 2022 16:49:53 +0800 you wrote:

rhashtable_lookup_fast() returns NULL pointer not ERR_PTR(), so it can return fib_node directly in prestera_fib_node_find().

Fixes 16de3db1208a ("net: marvell: prestera: add hardware router objects accounting for lpm")

[...]

Here is the summary with links:
- [net-next,1/2] net: marvell: prestera: Fix return value check in prestera_fib_node_find()

    https://git.kernel.org/netdev/net-next/c/d434ee9dee6d
  - [net-next,2/2] net: marvell: prestera: Fix return value check in prestera_kern_fib_cache_find()
    https://git.kernel.org/netdev/net-next/c/37f40f81e589

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html