提交 f6882b8f 编写于 作者: Y Yang Yingliang 提交者: David S. Miller

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: 47327e19 ("net: prestera: acl: migrate to new vTCAM api")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ab11393f
......@@ -419,11 +419,8 @@ struct prestera_acl_rule_entry *
prestera_acl_rule_entry_find(struct prestera_acl *acl,
struct prestera_acl_rule_entry_key *key)
{
struct prestera_acl_rule_entry *e;
e = rhashtable_lookup_fast(&acl->acl_rule_entry_ht, key,
__prestera_acl_rule_entry_ht_params);
return IS_ERR(e) ? NULL : e;
return rhashtable_lookup_fast(&acl->acl_rule_entry_ht, key,
__prestera_acl_rule_entry_ht_params);
}
static int __prestera_acl_rule_entry2hw_del(struct prestera_switch *sw,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册