diff mbox series

[net-next,1/2] net: marvell: prestera: Fix return value check in prestera_fib_node_find()

Message ID 20220223084954.1771075-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit d434ee9dee6dc75984897f183df773427a68a1ff
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/2] net: marvell: prestera: Fix return value check in prestera_fib_node_find() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: oleksandr.mazur@plvision.eu; 1 maintainers not CCed: oleksandr.mazur@plvision.eu
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yang Yingliang Feb. 23, 2022, 8:49 a.m. UTC
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")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/ethernet/marvell/prestera/prestera_router_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 25, 2022, 5:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> 
> [...]

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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.c
index d62adb970dd5..5b0cf3be9a9e 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,