From: Thomas Gleixner <tglx@linutronix.de>
To: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] irq: generic-chip: provide irq_free_generic_chip()
Date: Thu, 9 Mar 2017 11:17:29 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1703091032020.3521@nanos> (raw)
In-Reply-To: <1488992645-9980-1-git-send-email-bgolaszewski@baylibre.com>
On Wed, 8 Mar 2017, Bartosz Golaszewski wrote:
> Some users of irq_alloc_generic_chip() are modules which can be
> removed (e.g. gpio-ml-ioh) but have no means of freeing the allocated
> generic chip. Provide a function for that.
They have means, i.e. kfree(gc). If you want a wrapper for that then please
make it a simple static inline w/o the bloat of an exported symbol.
But, what you really want is a proper counterpart to
irq_alloc_generic_chip() which undoes everything what
irq_alloc_generic_chip() does.
You have to call irq_remove_generic_chip() before calling kfree() or the
wrapper anyway. And looking at the 3 users of irq_remove_generic_chip():
Two of them (drivers/gpio/gpio-tb10x.c drivers/mfd/jz4740-adc.c) do
irq_remove_generic_chip(gc)
kfree(gc)
The third one (arch/arm/mach-omap2/prm_common.c) leaks the generic chip
memory....
So the proper solution is to rename irq_remove_generic_chip() to
irq_destroy_generic_chip() and do the kfree() at the end of that function.
Hmm?
tglx
next prev parent reply other threads:[~2017-03-09 10:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 17:04 Bartosz Golaszewski
2017-03-09 8:05 ` Marc Zyngier
2017-03-09 10:17 ` Thomas Gleixner [this message]
2017-03-09 10:35 ` Bartosz Golaszewski
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=alpine.DEB.2.20.1703091032020.3521@nanos \
--to=tglx@linutronix.de \
--cc=bgolaszewski@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.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 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®