All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul.moore@hp.com>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH][NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def.
Date: Tue, 12 Feb 2008 11:34:09 -0500	[thread overview]
Message-ID: <200802121134.09965.paul.moore@hp.com> (raw)
In-Reply-To: <47B1C8E4.6010908@openvz.org>

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 <xemul@openvz.org>

Good catch, thanks.

Acked-by: Paul Moore <paul.moore@hp.com>

> ---
>
> 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

  reply	other threads:[~2008-02-12 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12 16:27 [PATCH][NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def Pavel Emelyanov
2008-02-12 16:34 ` Paul Moore [this message]
2008-02-13  6:15   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802121134.09965.paul.moore@hp.com \
    --to=paul.moore@hp.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.