netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def.
@ 2008-02-12 16:27 Pavel Emelyanov
  2008-02-12 16:34 ` Paul Moore
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Emelyanov @ 2008-02-12 16:27 UTC (permalink / raw)
  To: David Miller; +Cc: Paul Moore, Linux Netdev List

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>

---

diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c
index 9a8ea01..fd46231 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)
 	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;
 }
 
 /*

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-13  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-12 16:27 [PATCH][NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def Pavel Emelyanov
2008-02-12 16:34 ` Paul Moore
2008-02-13  6:15   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).