[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27240C0AC20F114CBF8149A2696CBE4A01B806F5@SHSMSX101.ccr.corp.intel.com>
Date: Mon, 4 Nov 2013 03:47:39 +0000
From: "Liu, Chuansheng" <chuansheng.liu@...el.com>
To: Chanwoo Choi <cw00.choi@...sung.com>,
"Wang, Xiaoming" <xiaoming.wang@...el.com>
CC: "myungjoo.ham@...sung.com" <myungjoo.ham@...sung.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Zhang, Dongxing" <dongxing.zhang@...el.com>
Subject: RE: [PATCH] [extcon]:remove freed groups caused the panic or
warning in unregister flow
> -----Original Message-----
> From: Chanwoo Choi [mailto:cw00.choi@...sung.com]
> Sent: Monday, November 04, 2013 10:37 AM
> To: Wang, Xiaoming
> Cc: myungjoo.ham@...sung.com; linux-kernel@...r.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.
Powered by blists - more mailing lists