Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6801990rwi; Mon, 24 Oct 2022 06:21:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64y5HAE8VHSVFlDTo2J+8W1C7lFA/LKfTnZTBOZ5gJiO48kxsrv8rnEC/JKr5Xf9tsKfcC X-Received: by 2002:a05:6402:90e:b0:443:ec4b:2b03 with SMTP id g14-20020a056402090e00b00443ec4b2b03mr30322435edz.71.1666617660138; Mon, 24 Oct 2022 06:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666617660; cv=none; d=google.com; s=arc-20160816; b=m0390bg62ICe3DmQO7xupsXve0ACZRUNGTHJfOwxc5rVsGbqjgES4q3GWp8iBbtWbu bWxYkckARmlXPj96mHToB2SvGyVegIxzcjHIHgGMjMVQlEvAJ4m41Bvu2xrrzag4cr+Q 9rEgtGfqRvQGBXhqUzcDs1wktx32pJfGXpF3Oveu1DxnzOTKC3qBBtKyJGfIDPVLFRpM Fcnfq0Om5C1JrfyuCyPm7WT6zgkqpmCx5Wf8fkr0liILcPfKoiw2/Qbxujdk2naFX9ye fkRZGLf2vGxi/dY2zfdiuNyuYZbC3niJS6L0E3lbhhA/OaQJohie8kEsY0NUDQx4zfiG KMEg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ncrh4LKlHVvQtYJT+QR1ULqI34OmJaPmyfVts/ndP88=; b=S3RomOhXvCqskpiZUJ86Nt78CwE6RvBdyLmem5zUQwykuyUung077/dQ/o3mVjV+Gb VYLfRdxHrsgib6teOujRJ0cEngIAfwJZEN44TfAyJ7mpNPdD25d6c/cbNU6UcsADk4Hh 02vVEMY3Y0yvafTb6suh7Z3Q0EcbawuZDPfkURokfqRshoz78szbZ4r+VlTaOdsA3ANJ bbTqXgLL62u8GNdp6B7Nk1bSroDxOB8RmOFcg88RjD9lbT4D1STVHxIVUJVIbLKoGn9y Y+COztcGEVa4WrX5vU3pwcWGoisnuLCkZgshne3f9vKZF6CeJOI6TUpiNE0r8uXf/tCp GlnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LDGnHXHe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js10-20020a17090797ca00b0078e20d9c473si22783395ejc.764.2022.10.24.06.20.34; Mon, 24 Oct 2022 06:21:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LDGnHXHe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbiJXMIS (ORCPT + 99 others); Mon, 24 Oct 2022 08:08:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232599AbiJXMFq (ORCPT ); Mon, 24 Oct 2022 08:05:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC8EB7E30A; Mon, 24 Oct 2022 04:51:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 25261612C3; Mon, 24 Oct 2022 11:51:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3718AC433D7; Mon, 24 Oct 2022 11:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612297; bh=+IJfdwQZHLdBxmVW+3yGX0T13fs3Qxpi0bql/8osMgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LDGnHXHeSXslOuUXAxG0RV8jUwi3qHLEdq5x+AHsostU55LPP6H3xFzKwMoc9L2je fJttDwJmKT1b8uU4MVEXuuHhK+aRhAF36r2BuHyfkMdlTcmjJgUe5ceheO+j8CNYSE Kenkytqlbit3eQ6/XBzvWDUrU3yJG8f6RBXJHnJw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Lee Jones , Sasha Levin Subject: [PATCH 4.14 145/210] mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init() Date: Mon, 24 Oct 2022 13:31:02 +0200 Message-Id: <20221024113001.678082256@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 557244f6284f30613f2d61f14b579303165876c3 ] In lp8788_irq_init(), if an error occurs after a successful irq_domain_add_linear() call, it must be undone by a corresponding irq_domain_remove() call. irq_domain_remove() should also be called in lp8788_irq_exit() for the same reason. Fixes: eea6b7cc53aa ("mfd: Add lp8788 mfd driver") Signed-off-by: Christophe JAILLET Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/bcd5a72c9c1c383dd6324680116426e32737655a.1659261275.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/mfd/lp8788-irq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/lp8788-irq.c b/drivers/mfd/lp8788-irq.c index 792d51bae20f..ae65928f35f0 100644 --- a/drivers/mfd/lp8788-irq.c +++ b/drivers/mfd/lp8788-irq.c @@ -179,6 +179,7 @@ int lp8788_irq_init(struct lp8788 *lp, int irq) IRQF_TRIGGER_FALLING | IRQF_ONESHOT, "lp8788-irq", irqd); if (ret) { + irq_domain_remove(lp->irqdm); dev_err(lp->dev, "failed to create a thread for IRQ_N\n"); return ret; } @@ -192,4 +193,6 @@ void lp8788_irq_exit(struct lp8788 *lp) { if (lp->irq) free_irq(lp->irq, lp->irqdm); + if (lp->irqdm) + irq_domain_remove(lp->irqdm); } -- 2.35.1