From patchwork Wed Aug 8 14:47:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1296251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id B1CD33FC23 for ; Wed, 8 Aug 2012 14:52:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sz7YL-0005N8-QR; Wed, 08 Aug 2012 14:48:05 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sz7Xu-0005HJ-FG for linux-arm-kernel@lists.infradead.org; Wed, 08 Aug 2012 14:47:40 +0000 Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LoKJV-1TfJ3m0d45-00gkxB; Wed, 08 Aug 2012 16:47:35 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/11] gpio: em: do not discard em_gio_irq_domain_cleanup Date: Wed, 8 Aug 2012 16:47:23 +0200 Message-Id: <1344437248-20560-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1344437248-20560-1-git-send-email-arnd@arndb.de> References: <1344437248-20560-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:kYcpDsibcRvmGX0c1Q1GKw/zjB7CACtx7xRzF0IPMdr QThNqOPrYkHeeCv6tvYFpVWqRLUVxGPEC6acaRPOKFQDaScwQ6 7UOJwC+1VeW//zxuJMqdqUdE/PrUAbqrgsqhDSVvNE6KCUpGSg qvsB3hqP4l8Ot2mgeLSQKT7zBd8f/hLX+YNdk2rvESF/1pe8cg qxxLHXVui9JaAv3hcQBsmCPaTxieWQXKNiQnhfeSuuMIo8GV/d XvCWmbly7K4pOuAOTT8JRe6d/1doDEApsdm9EExpKTwLj18ims oI10xDGTD94A816ni8aP6iErbsMuSt7WvzCIezSIHEMRqwAXyp HkHtRLAwHAeZFAPjISrxiaQlWSszyVfcjTnmyQxCEjuPBO7P9S Y/UxJEZndvNCU/pwLn8arzxeCq5Hjx3H3o= X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.9 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Arnd Bergmann , Linus Walleij , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Magnus Damm , arm@kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Cc: Magnus Damm Cc: Linus Walleij Cc: Rafael J. Wysocki Acked-by: Linus Walleij --- drivers/gpio/gpio-em.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;