On Tuesday 12 February 2008 11:27:16 am Pavel Emelyanov wrote:
> 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]>

Good catch, thanks.

Acked-by: Paul Moore <[EMAIL PROTECTED]>

> ---
>
> 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;
>  }
>
>  /*

-- 
paul moore
linux security @ hp
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to