Re: [PATCH V2 2/2] clocksource: imx-gpt: add necessary kfree to avoid resource leak

From: Daniel Lezcano
Date: Sat Nov 17 2018 - 20:52:47 EST



Hi Anson,

On 06/11/2018 10:12, Anson Huang wrote:

[ ... ]

>>>> Please convert to timer-of API.
>>>
>>> This patch mainly to fix the potential resource leak issue, for
>>> converting to timer-of API, should I add another patch for it? Since
>>> it is a different subject.
>>
>> Actually I was unclear. The patch is duplicating the kfree in the error path,
>> usually a rollback routine should be provided.
>>
>> So instead of creating this rollback path, you can directly use the timer-of
>> which contains the error check and rollback.
>
> I understand the timer-of can save some code in timer driver, but current GPT
> driver is kind of complicated in order to support so many i.MX platforms with
> different GPT design, change it to timer-of will need some effort and I think we
> can do it later. If the duplicating kfree in error path confuses you, I can change
> it to rollback path you said. Below are 2 options in my mind:
>
> 1. add kfree to rollback path;
> 2. skip this patch, just apply 1/2 patch, and let me find some time to change GPT
> driver using timer-of.
>
> Which one do you prefer? Thanks.

I'm fine with option 2.

Thanks

-- Daniel

--
<http://www.linaro.org/> Linaro.org â Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog