[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180418075735epcms1p3c59f097441aabc6af5d7892298c6fdb2@epcms1p3>
Date: Wed, 18 Apr 2018 16:57:35 +0900
From: MyungJoo Ham <myungjoo.ham@...sung.com>
To: Chanwoo Choi <cw00.choi@...sung.com>,
arvindY <arvind.yadav.cs@...il.com>,
Kyungmin Park <kyungmin.park@...sung.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>
Subject: RE: Re: [PATCH] PM / devfreq: use put_device() instead of kfree()
>On 2018년 04월 13일 11:37, arvindY wrote:
>> On Friday 13 April 2018 07:59 AM, Chanwoo Choi wrote:
>>> On 2018년 04월 13일 11:15, arvindY wrote:
>>>> On Friday 13 April 2018 06:43 AM, Chanwoo Choi wrote:
>>>>> On 2018년 04월 13일 10:03, Chanwoo Choi wrote:
[]
>>>>>>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>>>>>>> index fe2af6a..a225b94 100644
>>>>>>> --- a/drivers/devfreq/devfreq.c
>>>>>>> +++ b/drivers/devfreq/devfreq.c
>>>>>>> @@ -625,7 +625,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
>>>>>>> err = device_register(&devfreq->dev);
>>>>>>> if (err) {
>>>>>>> mutex_unlock(&devfreq->lock);
>>>>>>> - goto err_dev;
>>>>>>> + put_device(&devfreq->dev);
>>>>>>> + goto err_out;
>>>>>>> }
>>>>>>> devfreq->trans_table = devm_kzalloc(&devfreq->dev,
>>>>>>> @@ -671,6 +672,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
>>>>>>> mutex_unlock(&devfreq_list_lock);
>>>>>>> device_unregister(&devfreq->dev);
>>>>>>> + devfreq = NULL;
>>>>>>> err_dev:
>>>>>>> if (devfreq)
>>>>>>> kfree(devfreq);
>>>>>>>
Ah.. this was critcal. Thanks!
Acked-by: MyungJoo Ham <myungjoo.ham@...sung.com>
>Reviewed-by: Chanwoo Choi <cw00.choi@...sung.com>
Cheers,
MyungJoo
Powered by blists - more mailing lists