All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Xidong Wang <wangxidong_97@163.com>,
	Mans Rullgard <mans@mansr.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH 1/1] mtd:nand:fix memory leak
Date: Thu, 5 Apr 2018 14:00:39 +0200	[thread overview]
Message-ID: <1cafa2b3-3f0b-eae5-338d-d6119aac55f0@free.fr> (raw)
In-Reply-To: <20180405134759.2cc29d42@bbrezillon>

On 05/04/2018 13:47, Boris Brezillon wrote:

> On Thu, 5 Apr 2018 13:26:31 +0200, Marc Gonzalez wrote:
> 
>> IIUC, you're saying:
>> 1) use devm_clk_get() instead of clk_get() to solve the memory leak
>> 2) call clk_prepare_enable() before clk_get_rate() even if the former is a no-op today
> 
> + a disable_unprepare() in the remove path and a another one in the
> error path (in case something fails after prepare_enable() has been
> called).

I hate C error-handling with all my heart...

Why is it taking so long for Linux APIs to be turned into devm
managed functions? It makes life so much easier...

  reply	other threads:[~2018-04-05 12:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04  3:05 [PATCH 1/1] mtd:nand:fix memory leak Xidong Wang
2018-04-04  3:05 ` Xidong Wang
2018-04-04  6:28 ` Miquel Raynal
2018-04-04  7:07   ` Boris Brezillon
2018-04-04  7:08     ` Boris Brezillon
2018-04-05  9:12       ` Marc Gonzalez
2018-04-05  9:44         ` Miquel Raynal
2018-04-05 11:04           ` Boris Brezillon
2018-04-05  9:54         ` Boris Brezillon
2018-04-05 11:26           ` Marc Gonzalez
2018-04-05 11:47             ` Boris Brezillon
2018-04-05 12:00               ` Marc Gonzalez [this message]
2018-04-05 12:57     ` [PATCH v2] mtd: rawnand: tango: Fix struct clk " Marc Gonzalez
2018-04-05 14:22       ` Miquel Raynal
2018-04-24 15:50       ` Boris Brezillon

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=1cafa2b3-3f0b-eae5-338d-d6119aac55f0@free.fr \
    --to=marc.w.gonzalez@free.fr \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mans@mansr.com \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=wangxidong_97@163.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.