All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: "Liu, Chuansheng" <chuansheng.liu@intel.com>
Cc: "Wang, Xiaoming" <xiaoming.wang@intel.com>,
	"myungjoo.ham@samsung.com" <myungjoo.ham@samsung.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Zhang, Dongxing" <dongxing.zhang@intel.com>
Subject: Re: [PATCH] [extcon]:remove freed groups caused the panic or warning in unregister flow
Date: Mon, 04 Nov 2013 13:24:14 +0900	[thread overview]
Message-ID: <5277216E.2080001@samsung.com> (raw)
In-Reply-To: <27240C0AC20F114CBF8149A2696CBE4A01B806F5@SHSMSX101.ccr.corp.intel.com>

On 11/04/2013 12:47 PM, Liu, Chuansheng wrote:
> 
> 
>> -----Original Message-----
>> From: Chanwoo Choi [mailto:cw00.choi@samsung.com]
>> Sent: Monday, November 04, 2013 10:37 AM
>> To: Wang, Xiaoming
>> Cc: myungjoo.ham@samsung.com; linux-kernel@vger.kernel.org; Liu,
>> Chuansheng; Zhang, Dongxing
>> Subject: Re: [PATCH] [extcon]:remove freed groups caused the panic or warning
>> in unregister flow
> 
> 
>> As you comment, my opinion has memory leak problem. My mistake.
>> But, I prefer to call 'device_unregister' at the end of extcon_dev_unregister().
>> To resolve kernel panic, I think we could use 'devm_kzalloc' instead of
>> kzalloc/kfree.
>> What is your opinion about my approach?
>>
> That sounds good.
> But in function extcon_dev_register(), the device attributes are allocated before device_register(),
> and before device_register(), the function devm_kzalloc() can not be used.
> 

We could use 'edev->dev->parent' pointer for devm_kzalloc()
but it is ambiguous method.

OK, applied this patch.

Thanks,
Chanwoo Choi


      reply	other threads:[~2013-11-04  4:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01 22:48 [PATCH] [extcon]:remove freed groups caused the panic or warning in unregister flow Wang, Xiaoming
2013-11-04  1:06 ` Liu, Chuansheng
2013-11-04  1:43 ` Chanwoo Choi
2013-11-04  2:07   ` Wang, Xiaoming
2013-11-04  2:36     ` Chanwoo Choi
2013-11-04  3:47       ` Liu, Chuansheng
2013-11-04  4:24         ` Chanwoo Choi [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=5277216E.2080001@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=chuansheng.liu@intel.com \
    --cc=dongxing.zhang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=xiaoming.wang@intel.com \
    /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.