From: Tejun Heo <tj@kernel.org>
To: Chen Gang <gang.chen@asianux.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel/workqueue.c: kfree issue, need check flag 'WQ_UNBOUND' when processing failure.
Date: Wed, 15 May 2013 14:11:16 -0700 [thread overview]
Message-ID: <20130515211116.GD26222@htj.dyndns.org> (raw)
In-Reply-To: <5192E62C.5090107@asianux.com>
On Wed, May 15, 2013 at 09:34:36AM +0800, Chen Gang wrote:
> On 05/14/2013 11:20 PM, Tejun Heo wrote:
> > On Tue, May 14, 2013 at 09:06:40PM +0800, Chen Gang wrote:
> >> err_destroy:
> >> destroy_workqueue(wq);
> >> + if (flags & WQ_UNBOUND) {
> >> +err_free_wq:
> >> + free_workqueue_attrs(wq->unbound_attrs);
> >> + kfree(wq);
> >> + }
> >
> > Doesn't the above make the code free wq twice on after err_destroy?
> >
>
> Oh, it is my fault. I did not see the put_pwq_unlocked() in details,
> next I should read the code carefully.
We're still leaking unbound_attrs in the failure path, right? We can
probably just add unconditional free_workqueue_attrs() in err_free_wq?
Thanks.
--
tejun
next prev parent reply other threads:[~2013-05-15 21:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 13:06 Chen Gang
2013-05-14 15:20 ` Tejun Heo
2013-05-15 1:34 ` Chen Gang
2013-05-15 21:11 ` Tejun Heo [this message]
2013-05-16 2:04 ` Chen Gang
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=20130515211116.GD26222@htj.dyndns.org \
--to=tj@kernel.org \
--cc=gang.chen@asianux.com \
--cc=linux-kernel@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
Powered by JetHome