mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gen Zhang <blackgod016574@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: rafael@kernel.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [Question: devm_kfree] When should devm_kfree() be used?
Date: Tue, 28 May 2019 20:47:48 +0800	[thread overview]
Message-ID: <20190528124748.GA23945@zhanggen-UX430UQ> (raw)
In-Reply-To: <20190528124138.GA3578@kroah.com>

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

      reply	other threads:[~2019-05-28 12:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28  0:32 Gen Zhang
2019-05-28  6:49 ` Greg KH
2019-05-28  7:14   ` Gen Zhang
2019-05-28 12:41     ` Greg KH
2019-05-28 12:47       ` Gen Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190528124748.GA23945@zhanggen-UX430UQ \
    --to=blackgod016574@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®