From: Pavel Emelyanov Date: Wed, 13 Feb 2008 06:15:14 +0000 (-0800) Subject: [NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def. X-Git-Tag: v2.6.25-rc2~2^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c3a0a254e5d706d3fe01bf42261534858d05586;p=platform%2Fkernel%2Flinux-exynos.git [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 Acked-by: Paul Moore Signed-off-by: David S. Miller --- 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; } /*