: Fix lookup logic of netlbl_domhsh_search_def.
Subsystems (3)
PATCH 1/1 : 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 <[email protected]>
---
net/netlabel/netlabel_domainhash.c +3 -3
@@ -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; }/*
Quoted 6 lines · Pavel Emelyanov
Currently, if the call to
netlbl_domhsh_searchsucceeds the return result will still be NULL.Fix that, by returning the found entry (if any).
Signed-off-by Pavel Emelyanov <[email protected]>
Good catch, thanks.
Acked-by Paul Moore <[email protected]>
Quoted 22 lines
---
(quoted diff) +0
-0
b/net/netlabel/netlabel_domainhash.cindex 9a8ea01..fd46231 100644net/netlabel/netlabel_domainhash.c +3
-3@@ -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; }/*
Signature · 2 lines
paul moore linux security @ hp
From: Paul Moore <[email protected]>
Date: Tue, 12 Feb 2008 11:34:09 -0500
Quoted 11 lines · Pavel Emelyanov
Quoted 6 lines
Currently, if the call to
netlbl_domhsh_searchsucceeds the return result will still be NULL.Fix that, by returning the found entry (if any).
Signed-off-by Pavel Emelyanov <[email protected]>Good catch, thanks.
Acked-by Paul Moore <[email protected]>
Applied, thanks everyone.