Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1130581rwi; Wed, 19 Oct 2022 07:06:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Qtcasd6LWCTh4xQbhstmX+dqKRM+QtFcdq7k3vEdUbR23ltsjrd45rHoZ5M77gx4YrRMO X-Received: by 2002:a05:6402:1906:b0:45d:db20:7709 with SMTP id e6-20020a056402190600b0045ddb207709mr7412827edz.406.1666188368946; Wed, 19 Oct 2022 07:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188368; cv=none; d=google.com; s=arc-20160816; b=NpG7iyomkRd0pP2RpLYBFyXBww70ndHGfapf+T7NCj+UNM/+f9GKlyzflfC1FgXFlb e+fgzAWMdS+IksocKLQnmVFH6hPhSaywHIbCEyiVG4JflnfcEWRaq0pebUt0Nozyrgkm SZfVQOMbqJ+X4Q57ZYcTaTr4L3KX82ek4kpurC6oJXxgYNbj/7ckaYjyGvSBGM13+DA5 1BJ5kND2ptbCYcsRpBhFl+d21okutEyt6kBy4YPNk4cHBd97M+yVfhWKycY+V1fCsA/a gcRMt8PIWNpJnYuBrvWhsnRZwQxPUYLa80uC5v8HADF+JAqA/l5UrbFitM/b/oKdxJjQ B1lw== 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=zzon+syC4d/y8skF7+zvINdnuWToVbLqabMxD8RyuoU=; b=lBi2ed+Wo22T1bb0mN5GKOrYOreSjK9jDodwC2BA1d9VyE0QNxoF9ouD97T+L4y4iH MD5bavRZHOOZUhYeNeUS0fs9+Ulfs1ZlRa0XB763cfqq3TG1lpWjHspeD94tY/uvbDTj hNJZg7VFj/ks0hrSwxBprFb0XeYcW6qgOjCCXIKuqNKHtxF2KxrMrxfNqgq5iXHFK8Zt X6NXrgvGsV++gxnmVvc/agx7jFw/5J+cgxtLe+e1/OyloXzzlocQQT6qN84eqULjNQT7 uFoPoWg3WrY6TmShEUVM16CYmeB2wf4rEpRKAL3CEsxPd/RLmufCXWTES+7NEkxZqPdc b3Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CagYI3fh; 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 js2-20020a17090797c200b0078d4ba46622si14996038ejc.616.2022.10.19.07.05.41; Wed, 19 Oct 2022 07:06:08 -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=CagYI3fh; 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 S232488AbiJSNCq (ORCPT + 99 others); Wed, 19 Oct 2022 09:02:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231755AbiJSNCR (ORCPT ); Wed, 19 Oct 2022 09:02:17 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37448630C; Wed, 19 Oct 2022 05:45:41 -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 sin.source.kernel.org (Postfix) with ESMTPS id 78E06CE215C; Wed, 19 Oct 2022 09:03:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58610C433D6; Wed, 19 Oct 2022 09:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170230; bh=Ku35vuD17YGpq0QHl+DAKe80YrZ/0TpL18rzyvhTdJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CagYI3fh6r38FyflXj4TC2rflExuXnvmtp87s4RFxpALov6+hTXxTtKi+6/ZTDQxy BqKSEAfhT7Y7Ldx6BNBNHsoxtA6EnRa7Mon5icmMdE0YL/ejB6bxqyfutUsKX1FcD8 lpa5ar5TOvJIUAc+G9gB1pMe1c36xlk6HL65OSVM= 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 6.0 577/862] mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init() Date: Wed, 19 Oct 2022 10:31:04 +0200 Message-Id: <20221019083315.456426694@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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 348439a3fbbd..39006297f3d2 100644 --- a/drivers/mfd/lp8788-irq.c +++ b/drivers/mfd/lp8788-irq.c @@ -175,6 +175,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; } @@ -188,4 +189,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