Skip to content

Commit

Permalink
[NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def.
Browse files Browse the repository at this point in the history
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: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Feb 13, 2008
1 parent 0f8f27c commit 4c3a0a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/netlabel/netlabel_domainhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain)
entry = netlbl_domhsh_search(domain);
if (entry == NULL) {
entry = rcu_dereference(netlbl_domhsh_def);
if (entry != NULL && entry->valid)
return entry;
if (entry != NULL && !entry->valid)
entry = NULL;
}

return NULL;
return entry;
}

/*
Expand Down

0 comments on commit 4c3a0a2

Please sign in to comment.