From patchwork Mon Oct 24 11:31:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp431616wru; Mon, 24 Oct 2022 05:44:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4G0zKoH+GcrwTCEMi1RMAbI74WZEGh8XzBuaeiZtO0wHNazQlQgAYTH8sbAAeTgbwnNXnA X-Received: by 2002:a17:906:d550:b0:78d:a6d4:c18f with SMTP id cr16-20020a170906d55000b0078da6d4c18fmr27912225ejc.113.1666615458524; Mon, 24 Oct 2022 05:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615458; cv=none; d=google.com; s=arc-20160816; b=aAYMRYyWmd8R8C0ZUOF0oA+qIW5QZO58cHB+eDUDHw61TIGtgiTnU6WbKwYpAd3rje pdvLPC4jSPnYz7kW5RHLgdgHq1EKSXD5+oLPJ9pqyZFn5CuUUQDTBNIgggysOXxXUBPL tWEufXUROq/glg6JWGS3NWl97UI5lFnaeJLJ+BzVIHsURx0iJJERjZYHoQCTA14E0G+J Z7m/QfOvQSm9tnR/ttuhqD83fY38dEvMywRL9tDO0SXWfKYrEPTQFABPeq0pf9Ej+Y6G ZF7siCNPwnwgSUMjbS35MKmpCc0TrhRqfn5eieUhKJS2Lj3TmbLyJH/N92rPwsS3t+qX 5yKw== 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=D361HB3rPkJ76MFjDWlW2Kgs3hQ0UAOAqSLYnuS1c/z1UPyCdoEqpmAr8Hk45GUVaE Hj72/8qd024Z+vceAlfiFICXvAt50Gor9WnUikimdp2aCbFXL8fyDOduV6aARMhF+npM C1WK4gbzIMFheihr/30Sg7zmj9K0XlLxacTorPFXRiAhh7cTeYDiSx3VEXbNalqlvptm mltvAKVyijcfc2TiChV0q8pSM3x2c0tKNRX5MuyOVHvy3nrWYFtJbRok7jE7/qFNoGfR /J+MDgkBwiFnI6ETV1YjV/MnD2SvettSN81zFWHgEXzj6nSSM6Hx4IDe/NpWoxD0O36h vHYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ljYGIgWJ; 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 dn19-20020a17090794d300b007806964b2fcsi7467419ejc.447.2022.10.24.05.43.52; Mon, 24 Oct 2022 05:44:18 -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=ljYGIgWJ; 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 S230340AbiJXMiA (ORCPT + 99 others); Mon, 24 Oct 2022 08:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234089AbiJXMdk (ORCPT ); Mon, 24 Oct 2022 08:33:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7158634DCA; Mon, 24 Oct 2022 05:04:49 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3EC72B811BE; Mon, 24 Oct 2022 12:02:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93F8AC433C1; Mon, 24 Oct 2022 12:02:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612945; bh=+IJfdwQZHLdBxmVW+3yGX0T13fs3Qxpi0bql/8osMgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ljYGIgWJmhnTuHsXGWwtwc3Zh198H1oFulil5+Ev9NqfvTrNcOqbcNZGWI5bw20+4 Ovltbmu3C1wn09me6a7xCSWRi9XyCZhHbzORmFmXaCdIRjrEs5VxBKIQ3NNO3ZgXP1 rX1NaFot6lELeHDd0iZPd1uS6LTnODcvUliFkL/s= 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.19 152/229] mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init() Date: Mon, 24 Oct 2022 13:31:11 +0200 Message-Id: <20221024113003.931698972@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747572971334149780?= X-GMAIL-MSGID: =?utf-8?q?1747572971334149780?= 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); }