[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190528124748.GA23945@zhanggen-UX430UQ>
Date: Tue, 28 May 2019 20:47:48 +0800
From: Gen Zhang <blackgod016574@...il.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: rafael@...nel.org, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [Question: devm_kfree] When should devm_kfree() be used?
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
Powered by blists - more mailing lists