From patchwork Mon Oct 24 11:31:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419642wru; Mon, 24 Oct 2022 05:16:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6u5pQBimyhgshqDWXA4I6rrl8EFBEvpxXxDQ8p4qHIXrt5NwJxwD4NgeaU3CzQPf5vYISR X-Received: by 2002:a05:6402:f2a:b0:461:eff7:bae8 with SMTP id i42-20020a0564020f2a00b00461eff7bae8mr1179476eda.322.1666613798970; Mon, 24 Oct 2022 05:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613798; cv=none; d=google.com; s=arc-20160816; b=FgiV696J7AjtFJBZJjVR+FkCgmJF3prwsdRuadpiGNS6eU1W1jIRSSMCAartztvMGD qYsjFHm7OAJ9HMxyo2R1dG8yiJj8pWPw5MVRRksKb/qSMXGRgwElAESpuQIfxqmPSLoR l17uEUknupON95vPighoboAHhWYGDRMX/g80Nm17QL429+IPPjaajJh2fRFg2BxvwsLp NhCvLGvOorjD2h18NH/P+FPlVn4TsrBmjH1+owDg+tUl/ilbPOgEUbUgnV8dgju+EwIH 8eOvAx5HJfJVGIYl5B4JedAZfJcqCGEVXtGRN6J8yIxkLj2HkHD3bquQfJQCQYYFZBvr mHzg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n14-20020a170906700e00b007330c08fe49si21610441ejj.206.2022.10.24.05.16.14; Mon, 24 Oct 2022 05:16:38 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747571230917753846?= X-GMAIL-MSGID: =?utf-8?q?1747571230917753846?= 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); }