diff mbox

[06/11] gpio: em: do not discard em_gio_irq_domain_cleanup

Message ID 1344437248-20560-7-git-send-email-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann Aug. 8, 2012, 2:47 p.m. UTC
The newly added gpio-em driver marks its em_gio_irq_domain_cleanup
function as __devexit, which would lead to that function being
discarded in case CONFIG_HOTPLUG is disabled. However, the function
is also called by the error handling logic em_gio_probe, which
would cause a jump into a NULL pointer if it was removed from the
kernel or module.

Without this patch, building kzm9d_defconfig results in:

WARNING: drivers/gpio/built-in.o(.devinit.text+0x330): Section mismatch in reference from the function em_gio_probe() to the function .devexit.text:em_gio_irq_domain_cleanup()
The function __devinit em_gio_probe() references
a function __devexit em_gio_irq_domain_cleanup().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
em_gio_irq_domain_cleanup() so it may be used outside an exit section.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Magnus Damm <damm@opensource.se>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/gpio/gpio-em.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Aug. 10, 2012, 10:59 a.m. UTC | #1
On Wed, Aug 8, 2012 at 4:47 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> The newly added gpio-em driver marks its em_gio_irq_domain_cleanup
> function as __devexit, which would lead to that function being
> discarded in case CONFIG_HOTPLUG is disabled. However, the function
> is also called by the error handling logic em_gio_probe, which
> would cause a jump into a NULL pointer if it was removed from the
> kernel or module.

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Will you push this through the ARM SoC tree or do you want me
to apply it to my GPIO tree?

Yours,
Linus Walleij
Arnd Bergmann Aug. 10, 2012, 11:33 a.m. UTC | #2
On Friday 10 August 2012, Linus Walleij wrote:
> On Wed, Aug 8, 2012 at 4:47 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 
> > The newly added gpio-em driver marks its em_gio_irq_domain_cleanup
> > function as __devexit, which would lead to that function being
> > discarded in case CONFIG_HOTPLUG is disabled. However, the function
> > is also called by the error handling logic em_gio_probe, which
> > would cause a jump into a NULL pointer if it was removed from the
> > kernel or module.
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Will you push this through the ARM SoC tree or do you want me
> to apply it to my GPIO tree?

I'm about to send out the whole series to Torvalds, so I'll just
keep it in now.

	Arnd
diff mbox

Patch

diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index 150d976..ae37181 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -266,7 +266,7 @@  static int __devinit em_gio_irq_domain_init(struct em_gio_priv *p)
 	return 0;
 }
 
-static void __devexit em_gio_irq_domain_cleanup(struct em_gio_priv *p)
+static void em_gio_irq_domain_cleanup(struct em_gio_priv *p)
 {
 	struct gpio_em_config *pdata = p->pdev->dev.platform_data;