Commit 4c3a0a25 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

[NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def.

Currently, if the call to netlbl_domhsh_search succeeds the
return result will still be NULL.

Fix that, by returning the found entry (if any).
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Acked-by: default avatarPaul Moore <paul.moore@hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f8f27c3
...@@ -150,11 +150,11 @@ static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain) ...@@ -150,11 +150,11 @@ static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain)
entry = netlbl_domhsh_search(domain); entry = netlbl_domhsh_search(domain);
if (entry == NULL) { if (entry == NULL) {
entry = rcu_dereference(netlbl_domhsh_def); entry = rcu_dereference(netlbl_domhsh_def);
if (entry != NULL && entry->valid) if (entry != NULL && !entry->valid)
return entry; entry = NULL;
} }
return NULL; return entry;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment