Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: prestera: acl: fix return value check in prestera_acl_rule_entry_find()

rhashtable_lookup_fast() returns NULL pointer not ERR_PTR().
Return rhashtable_lookup_fast() directly to fix this.

Fixes: 47327e198d42 ("net: prestera: acl: migrate to new vTCAM api")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yang Yingliang and committed by
David S. Miller
f6882b8f ab11393f

+2 -5
+2 -5
drivers/net/ethernet/marvell/prestera/prestera_acl.c
··· 419 419 prestera_acl_rule_entry_find(struct prestera_acl *acl, 420 420 struct prestera_acl_rule_entry_key *key) 421 421 { 422 - struct prestera_acl_rule_entry *e; 423 - 424 - e = rhashtable_lookup_fast(&acl->acl_rule_entry_ht, key, 425 - __prestera_acl_rule_entry_ht_params); 426 - return IS_ERR(e) ? NULL : e; 422 + return rhashtable_lookup_fast(&acl->acl_rule_entry_ht, key, 423 + __prestera_acl_rule_entry_ht_params); 427 424 } 428 425 429 426 static int __prestera_acl_rule_entry2hw_del(struct prestera_switch *sw,