From patchwork Mon Oct 24 11:31:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp459347wru; Mon, 24 Oct 2022 06:39:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68zCW7Nt4uPWefZrvH9i7svTJQuOUEgDe2F4I5Ptz46pEGVeXOZJu3OJUuB8cgSmBwzNER X-Received: by 2002:a17:906:58d2:b0:78d:9d2f:3005 with SMTP id e18-20020a17090658d200b0078d9d2f3005mr26836924ejs.697.1666618764957; Mon, 24 Oct 2022 06:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618764; cv=none; d=google.com; s=arc-20160816; b=CBqEVo+U7dp9ayiiqB5U4u8sKHZ9botyKNJ25GdmB9y1W3n02J9hUC16fUWqyEflYs 5giZXhqR5mN18sxgd4tBaVxxdbDyseJMhUzewdSRqke7eWlC9oEBgD+ShcYZPyct6Knu zECLa1iZhp5JUw1ikrE5lVAstCUacKzQpe7sLpSLhxfBjP8Utz1PjOd37pfMBEZLiTmR J9JznTYiig25rHtm31h/HQl8/V+jF+TgUlh8C8H8p9tqdVGxI70I289aT8XgzUdM3yUT axINz/rcDgPXuicRaV6h1XnJfd2dYIqvwtUfGnntyCqt8qxyeaXODzv+AJ349YzMs8t0 kA5w== 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=F7YhCsMC4AcbOSjUcUSOWknElbIK0aDvLiJOdfjEmXgU9wyabrvGW8hWtubuO7H+gD AqMbI+IEJYTbv1/Uv3nQopAff9ZAq+YseGgl9BVfJuEk5WuuV9JomabaOp94Kq8rtJ3P yKH34Gk/L4NI/+AIEM+MukhVXTxxd9zEU5rve8kBk59m5McdPt+i0eiw+l2bXa326v4k s95U/F1xSku9CPlQox4uEILpS5xBXw5NFoh54X/hnafHPsdWc+RZrTEbXOZ9SYjQVgFe Al7tl7NrwzRr2FDFwoGeVBwT4eNShY1AJz3jSfLdgsvh+FBJ40z+OLRuz+7vGBOGt83/ lAMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T1jNKM9x; 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 s5-20020a170906500500b0078255525a6fsi25509229ejj.671.2022.10.24.06.38.59; Mon, 24 Oct 2022 06:39:24 -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=T1jNKM9x; 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 S236105AbiJXNer (ORCPT + 99 others); Mon, 24 Oct 2022 09:34:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236221AbiJXNaA (ORCPT ); Mon, 24 Oct 2022 09:30:00 -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 D114C1B9D2; Mon, 24 Oct 2022 05:33:13 -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 986A661316; Mon, 24 Oct 2022 12:12:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5763C433D6; Mon, 24 Oct 2022 12:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613579; bh=Ku35vuD17YGpq0QHl+DAKe80YrZ/0TpL18rzyvhTdJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T1jNKM9xxD57yNy+/qBhZOkspWV7x5VGskmW5hTVknz2/0A8UZazGiXHw9RlcKGmD Se9D77dX2jhWz6Gfo4SH+1RfuFHBuOcw8n0H0kXEl20Lxt+GMJRi+CVlfGA/6df7pC uYNvZluCUQsoUJOnU8tNzmA8e3b0uKlG9mMcnKG0= 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 5.4 160/255] mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init() Date: Mon, 24 Oct 2022 13:31:10 +0200 Message-Id: <20221024113007.999419911@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747576438306464043?= X-GMAIL-MSGID: =?utf-8?q?1747576438306464043?= 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); }