Re: [Question: devm_kfree] When should devm_kfree() be used?

From: Gen Zhang
Date: Tue May 28 2019 - 08:51:20 EST


On Tue, May 28, 2019 at 02:41:38PM +0200, Greg KH wrote:
> No, you are not leaking any memory if you do not call that function.
> Try it and see :)
>
> The function is there if you just want to "free the memory now!", it's
> not necessary if you return an error as when the device is removed the
> memory will be freed then (or if probe fails, depending on the code
> path.)
>
> thanks,
>
> greg k-h
Thanks for your patient replies, Greg. I thinks I am getting to know
this issue.

Thanks
Gen