Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1574036pxb; Fri, 20 Aug 2021 08:39:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwR15lxaCxRsrGpwTk2l4czrLu6EZJ8jkWHJJPXciVHpIs/dl2RoMzGl9+M6milOlc0qPqL X-Received: by 2002:a17:906:7b53:: with SMTP id n19mr22336547ejo.14.1629473998708; Fri, 20 Aug 2021 08:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629473998; cv=none; d=google.com; s=arc-20160816; b=wzS7nNThQNBCkxGjotcYoLTdBGolYPmQKyCvdFl7kT/uVt8vmHBpvg4qAuKfnSE4u2 nQbUE9o+TfeS4odepovKDNl6Z5AL3eqs76cTf6HkjB9SI4cq5SdiGpe543eQle7nYjaY /qnCT1jzeHFNKlt99uBM6Wa0iBp7zXfXCUykeddstTauZrSyPID+v6rgoNS9TE/stLjC FjdebgQIefDFeyBhH02gUwTxIP0VYp+sccwQAlnz1AXgu+uHlB9822/cd+W9aHM9mTfj +S8Y9qLpuG0CohzTrMNyeynKnyBvqi0A3DG1eX4oe1+6hkLTOgQrSeQun05DLbgUPuy1 m/gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wSmN9nhhl2AeMjEfnyYF5RjH+JVqTudfRMKJXqESpDE=; b=hoQQtwQ6Aka/aVVkXEyh/Q31NOfepH40lRSBzF98m8a0CDRyOZ4n2MtHIWVgU4KB2J gpggOySVBaTz9g8G02zrBkdrvOpitFcq7EYkeW/1rBna8leKrlelTioXx7qnX+XPiI4q hg3s9LexeLP4oMgXZzXHo+IguI1VuiWLNW2BXLGSg0UZToZCnPaLv5xpbCa0bYNq7Fq2 C2updSQUkCo5d3cL0YHKIOr9DT8IhnTssGJwWqdwzyXMNJtoJD3FD7w7q2HNoS5CcV2x tY8oHLtlMnJsAVkXaC7iBc/5s94uT625rTiSjLBZRuFGyscQH6QiRBRLh4seRvCkCf+V Awjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si7312808ejf.122.2021.08.20.08.39.33; Fri, 20 Aug 2021 08:39:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241117AbhHTPig (ORCPT + 99 others); Fri, 20 Aug 2021 11:38:36 -0400 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:32531 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241097AbhHTPif (ORCPT ); Fri, 20 Aug 2021 11:38:35 -0400 Received: from pop-os.home ([90.126.253.178]) by mwinf5d04 with ME id jrdw2500b3riaq203rdwzy; Fri, 20 Aug 2021 17:37:57 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 20 Aug 2021 17:37:57 +0200 X-ME-IP: 90.126.253.178 From: Christophe JAILLET To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, alexandru.marginean@nxp.com, Laurentiu.Tudor@nxp.com, hui.song_1@nxp.com, andy.shevchenko@gmail.com, ran.wang_1@nxp.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/3] gpio: mpc8xxx: Fix a resources leak in the error handling path of 'mpc8xxx_probe()' Date: Fri, 20 Aug 2021 17:37:55 +0200 Message-Id: <800564ff82277544269add84bf78a5321e1090ed.1629472813.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 698b8eeaed72 ("gpio/mpc8xxx: change irq handler from chained to normal") has introduced a new 'goto err;' at the very end of the function, but has not updated the error handling path accordingly. Add the now missing 'irq_domain_remove()' call which balances a previous 'irq_domain_create_linear() call. Fixes: 698b8eeaed72 ("gpio/mpc8xxx: change irq handler from chained to normal") Signed-off-by: Christophe JAILLET --- Is the 'irq_set_chained_handler_and_data()' of the remove function also needed here? --- drivers/gpio/gpio-mpc8xxx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index 67dc38976ab6..241bcc80612e 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -416,6 +416,8 @@ static int mpc8xxx_probe(struct platform_device *pdev) return 0; err: + if (mpc8xxx_gc->irq) + irq_domain_remove(mpc8xxx_gc->irq); iounmap(mpc8xxx_gc->regs); return ret; } -- 2.30.2