public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: Tejun Heo <tj@kernel.org>
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: Thu, 16 May 2013 10:04:52 +0800	[thread overview]
Message-ID: <51943EC4.60400@asianux.com> (raw)
In-Reply-To: <20130515211116.GD26222@htj.dyndns.org>

On 05/16/2013 05:11 AM, Tejun Heo wrote:
> 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?
> 

It seems that it already done, the related patch is provided by you :
"6029a91 workqueue: add workqueue->unbound_attrs".

Please check.


Thanks.
-- 
Chen Gang

Asianux Corporation

      reply	other threads:[~2013-05-16  2:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 13:06 [PATCH] kernel/workqueue.c: kfree issue, need check flag 'WQ_UNBOUND' when processing failure Chen Gang
2013-05-14 15:20 ` Tejun Heo
2013-05-15  1:34   ` Chen Gang
2013-05-15 21:11     ` Tejun Heo
2013-05-16  2:04       ` Chen Gang [this message]

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=51943EC4.60400@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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