From: Patrick McHardy <kaber@trash.net>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: David Miller <davem@davemloft.net>,
Jamal Hadi Salim <hadi@cyberus.ca>,
netdev@vger.kernel.org
Subject: Re: [PATCH][NET_SCHED] cls_u32: refcounting fix for u32_delete()
Date: Fri, 11 Apr 2008 14:55:27 +0200 [thread overview]
Message-ID: <47FF5FBF.6030802@trash.net> (raw)
In-Reply-To: <20080411124519.GA2701@ff.dom.local>
Jarek Poplawski wrote:
> [NET_SCHED] cls_u32: refcounting fix for u32_delete()
>
> @@ -441,8 +443,10 @@ static int u32_delete(struct tcf_proto *tp, unsigned long arg)
> if (tp->root == ht)
> return -EINVAL;
>
> - if (--ht->refcnt == 0)
> + if (ht->refcnt == 1) {
> + ht->refcnt--;
> u32_destroy_hnode(tp, ht);
> + }
>
Shouldn't the refcount be decremented unconditionally?
Otherwise I'd suggest to reject the removal if refcnt > 1,
but silently doing nothing doesn't seem right.
next prev parent reply other threads:[~2008-04-11 12:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-11 12:45 [PATCH][NET_SCHED] cls_u32: refcounting fix for u32_delete() Jarek Poplawski
2008-04-11 12:55 ` Patrick McHardy [this message]
2008-04-11 13:23 ` Jarek Poplawski
2008-04-11 13:22 ` Patrick McHardy
2008-04-11 13:48 ` [PATCH take2][NET_SCHED] " Jarek Poplawski
2008-04-11 13:55 ` jamal
2008-04-13 1:37 ` David Miller
2008-04-11 14:00 ` Patrick McHardy
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=47FF5FBF.6030802@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=jarkao2@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).