diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-02-13 01:15:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-13 01:15:14 -0500 |
commit | 4c3a0a254e5d706d3fe01bf42261534858d05586 (patch) | |
tree | f689952b5544f23bf9cf83d1d69b02fb4abfc131 /net | |
parent | 0f8f27c39553dd3aedcaf5c39adefe3efef28b6b (diff) |
[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: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netlabel/netlabel_domainhash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c index 9a8ea0195c4f..fd462313471c 100644 --- a/net/netlabel/netlabel_domainhash.c +++ b/net/netlabel/netlabel_domainhash.c | |||
@@ -150,11 +150,11 @@ static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain) | |||
150 | entry = netlbl_domhsh_search(domain); | 150 | entry = netlbl_domhsh_search(domain); |
151 | if (entry == NULL) { | 151 | if (entry == NULL) { |
152 | entry = rcu_dereference(netlbl_domhsh_def); | 152 | entry = rcu_dereference(netlbl_domhsh_def); |
153 | if (entry != NULL && entry->valid) | 153 | if (entry != NULL && !entry->valid) |
154 | return entry; | 154 | entry = NULL; |
155 | } | 155 | } |
156 | 156 | ||
157 | return NULL; | 157 | return entry; |
158 | } | 158 | } |
159 | 159 | ||
160 | /* | 160 | /* |