Received: by 10.223.176.46 with SMTP id f43csp23674wra; Thu, 18 Jan 2018 13:19:42 -0800 (PST) X-Google-Smtp-Source: ACJfBosWczJbab+YYwxktUBXrxsGXqE3YxvMaeG/lnnzfqKS6kWYO3XUBg9hfOGHvGmc2dG8q/Yw X-Received: by 10.98.204.75 with SMTP id a72mr35479933pfg.211.1516310382516; Thu, 18 Jan 2018 13:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516310382; cv=none; d=google.com; s=arc-20160816; b=K+DqXKyczae0JUz4+fqoTfHZVzilOzWWAHlT68C9IvzcpTfr1i7fzW36OaEl/gXwTF TR8nCER8FxlkjkwXddN1vsn/tj9Y2QfCM+XnB9SiBAbo8zemXoOnisvlxZUz1Wjn/2Dq 3CzEEVmLwbnrRKMdU9kvlhZavcX6Bk1s/D+mcj93N2a+pGTfGDOqRn6V53cZtFHaZmZL BwzjHapUjHwPt7gTWiyQToBn/BXFSB/vqPwBKq5jbsSrmnzj8W1JbXsgWLEG2S1ysKIP ld/eNPzltqB7szp+iiKSWt9y4C4zlyGzknAc0yQVfbzPkJ7Mv4DZz31w/qraLsi3fBA9 xB4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=5cKG8QohtoaT7uz9I19qpXGbgGOwgaDGFxmabryJ0QI=; b=x1boeIFvfIV33XOBZZ9SaGTzam3KDQKC4N4y0RKQ5x3oqlJds2KB6ww7TqxRNa/LzH DYLNEFI9fuy1UjRnSng6eaT+y2QLhwoBCqWEy4Va/GRMJOwrWMDCH3oyN3VZN/ggpVnF 8/MSHBmrN4RfPNEgqu2sh6U9tNG9aW/044KWCLoMDQjlYXpGwzNgKfX49EWudoWpj/y/ XssCa9VMcZEiIlh7qOYrRc/8OAzhw5dJH4QEqqoa90ZZqK0QOToEVb63rzwq3ddyeVuJ 4QEI91qLe2hsu3KiFbzNAUewq9kNw7i/1Oi8MFTUscROHTTeuXLqTkF89/oyikz5x6qg LxLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6si7602534pfi.68.2018.01.18.13.19.27; Thu, 18 Jan 2018 13:19:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753649AbeARVRk (ORCPT + 99 others); Thu, 18 Jan 2018 16:17:40 -0500 Received: from mout.web.de ([212.227.17.11]:61373 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752100AbeARVRc (ORCPT ); Thu, 18 Jan 2018 16:17:32 -0500 Received: from [192.168.1.3] ([92.228.88.14]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LgHH6-1f8MeS4Adw-00ngax; Thu, 18 Jan 2018 22:17:21 +0100 Subject: [PATCH 3/3] irq-imx-gpcv2: Use common error handling code in imx_gpcv2_irqchip_init() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Jason Cooper , Marc Zyngier , Shenwei Wang , Thomas Gleixner Cc: LKML References: Message-ID: Date: Thu, 18 Jan 2018 22:17:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:8hQRUdp4x5EXFnPcAabyxpMeKS0ZlLHQ45C+PLnBMjWXhiK6+mn AGFV/OoR4/j/v5cB+1FtYGRodba+af/rslI1n/A8fAsS+pZC1/T7DEsXqdXystJVGHMt7gJ pn4he6cwcvx5Q7uSOGIajhb0IGOTwYOYuAZ91goIm2kH4Ho+BrRnEc3em32KdY9b9EnfTgW 2yj1/kRwGA+/oqqUxL8eA== X-UI-Out-Filterresults: notjunk:1;V01:K0:iXb1lqTWQC8=:uEwPfjiiLMm1HG1/sHhKPI Jp3dzRSeIWULFmUs5MyxEy2wq8JxekJwIktRWUTwJR6J3u2r9ytM5SQC6iSIXr9ww/mNZVlnt dZm39XZ+6/GkeMWIBO8GLZmJbWLebotKDOWzz6KvOOK4CG88Mq+QrLFIyUC1zSA7IUbObTW5x 88JcAiYDi7Ml8UX/esyoMcawBW3ROKTdhqKOo25W0manJ8v5Vad9jZOY0ZiXYmGOjwde9mm71 4FPP2hWWeTdO+RE8MiL0y4p1swgIaaJ30z6Gro1yu+hS3VPqHbNnP+ZvVoDKSIDlVy+Tn/Mgs HgSBxMnZv5qsNztQBLhIose23t513vYCo/ope0bUMHAydxlKDpL8ArXuoEQTaMT8/YYyZ31KC nZ8FLeib2SHFQTMBgeU1l5/5587kvxWea1qPK325iHDgy5S/n+EB3ApLpyPk3dX5FCL3T2/Jn f07VVx6TeGkNjIyT+20yIqLhzxnzN23tvXJ0wQWG3r6hpdX11ClrHuQKMtBTBCFOGnMCHlrh5 +t6L6O4eTJPcItAw8qTB5J0+g7CIDzB0QbeVIw1e5kTQwMRjvzBbUjEBDKAqyNwCpYocVNPzQ sK9RWjueZ6D5STzpLBHWmVnmJDrjnlR8LKwi0UsO2ZfaxfM6W6FzafMW9B0OQYS8NhytCAOdJ VwKA/4bXT57RfYU9WSHoeCKtfDItFyfIRMkXAv5AnSG8F6mP6QvXQr/5Y80xVy5SQ0AkV1LsB x7mf84gwEo5gUZ/AJRDAEs2Xr7DrsxYsRKC+DZTgEWuHH7U/jF/l3ZLSJNtdxy+KP+7Mpvnf9 BvaH0ou6iw4TqinqlBI3IXZrT1jCLxQWEr8t00eOoxev3UzfhQ= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Thu, 18 Jan 2018 22:00:05 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring --- drivers/irqchip/irq-imx-gpcv2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq-imx-gpcv2.c index e62f22c84112..2dc348581877 100644 --- a/drivers/irqchip/irq-imx-gpcv2.c +++ b/drivers/irqchip/irq-imx-gpcv2.c @@ -233,16 +233,14 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node, cd->gpc_base = of_iomap(node, 0); if (!cd->gpc_base) { pr_err("fsl-gpcv2: unable to map gpc registers\n"); - kfree(cd); - return -ENOMEM; + goto free_data; } domain = irq_domain_add_hierarchy(parent_domain, 0, GPC_MAX_IRQS, node, &gpcv2_irqchip_data_domain_ops, cd); if (!domain) { iounmap(cd->gpc_base); - kfree(cd); - return -ENOMEM; + goto free_data; } irq_set_default_host(domain); @@ -272,6 +270,10 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node, */ of_node_clear_flag(node, OF_POPULATED); return 0; + +free_data: + kfree(cd); + return -ENOMEM; } IRQCHIP_DECLARE(imx_gpcv2, "fsl,imx7d-gpc", imx_gpcv2_irqchip_init); -- 2.15.1