All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Fan Du <fan.du@windriver.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net] xfrm: Delete hold_timer when destroy policy
Date: Thu, 1 Aug 2013 14:01:47 +0200	[thread overview]
Message-ID: <20130801120146.GD25511@secunet.com> (raw)
In-Reply-To: <1375351716-3265-1-git-send-email-fan.du@windriver.com>

On Thu, Aug 01, 2013 at 06:08:36PM +0800, Fan Du wrote:
> Both policy timer and hold_timer need to be deleted when destroy policy
> Bad mood today, maybe I'm wrong about this...
> 
> Signed-off-by: Fan Du <fan.du@windriver.com>
> ---
>  net/xfrm/xfrm_policy.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
> index d8da6b8..f7078eb 100644
> --- a/net/xfrm/xfrm_policy.c
> +++ b/net/xfrm/xfrm_policy.c
> @@ -308,7 +308,7 @@ void xfrm_policy_destroy(struct xfrm_policy *policy)
>  {
>  	BUG_ON(!policy->walk.dead);
>  
> -	if (del_timer(&policy->timer))
> +	if (del_timer(&policy->timer) || del_timer(&policy->polq.hold_timer))
>  		BUG();
>  

The timers should be already deleted when xfrm_policy_destroy() is
called. This is just to check if that really happened and to
catch this bug if not. So it's not a bug fix, it just helps to
catch a potential bug. I'll consider to take this into ipsec-next
after some testing.

  reply	other threads:[~2013-08-01 12:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 10:08 [PATCH net] xfrm: Delete hold_timer when destroy policy Fan Du
2013-08-01 12:01 ` Steffen Klassert [this message]
2013-08-02  1:22   ` Fan Du
2013-08-06  8:05     ` Steffen Klassert

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=20130801120146.GD25511@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=fan.du@windriver.com \
    --cc=netdev@vger.kernel.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.