From patchwork Sat Oct 22 07:25:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1105905wrr; Sat, 22 Oct 2022 01:36:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4V1bKS2ykugA8/3PeTCzXiY2+/F/wJeKrRQcD52W5GEz+dujT3QRR/LpymGNH0K4xdT0dZ X-Received: by 2002:a17:902:aa42:b0:17e:b779:dadb with SMTP id c2-20020a170902aa4200b0017eb779dadbmr23836514plr.11.1666427788968; Sat, 22 Oct 2022 01:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427788; cv=none; d=google.com; s=arc-20160816; b=ppLVrUlDInxjAW4vjUHY9pN/5wnqlUKbTkIdoP3r7t/BYjDsfjYU3fwB0NRbOEU8H3 mg2Xhp+6//6JtPEQc5Yv7Ka3XkL20XCblibbdGiCzU6K7HPrfhlADdJlYbg5ZFvUe9le WljTUEiprtKRbX+1uXj2OPQ3pI/wjobrJOZf5nDnME6xap9owk+Jx9STQ2kwDbRpRb8E tZrGFYUiNsjc56A8ZDm/79pIDiB1QMq1QrtgdPm+gk02lmNW6Xw1hIXlk5cu3X7wjM9J pTkiwHoR/SILPP8+6wYCtszOK4FcSpN7rTbsP1h1eC/1GCvil36U6wCRhZLouWRDbqOm ccOg== 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=g3m1hXwNG2uFuVXB7IG4Uiw2jVQPaI95Y2LkOVdwMHwkjB8RhTLbME9OzGMq43aGPd g7xY8Z3h2iCOkkFoWcsNOYn5R2roBIVJx6gu1Befxkz7DK4UZMhpAvKpponQru8/luXO saAvqAvH6wpIJdqpxt+iqdua+Uwnjyg6Ixa9IBnprcWXwwGHYAZoHDfnQMOsHSpoMkUP 45t5TS1rTNpQ5j64VogYq0QRvFQniNBUoeB4nCOKpsknZ7lLV5DzmIH3wKc+zwV+xiED JB+cxx7cZcmfFxRvd7nFWiwRM6C18Qw69gEA6riw/CoP/YQij529+eifzXwoaAZDPby+ QxLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uewJ3Wn7; 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 il15-20020a17090b164f00b0020579d99c4dsi10639199pjb.138.2022.10.22.01.36.14; Sat, 22 Oct 2022 01:36:28 -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=uewJ3Wn7; 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 S233642AbiJVIUd (ORCPT + 99 others); Sat, 22 Oct 2022 04:20:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233696AbiJVITI (ORCPT ); Sat, 22 Oct 2022 04:19:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBDC02DE445; Sat, 22 Oct 2022 00:58:15 -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 7430160B94; Sat, 22 Oct 2022 07:55:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AB68C433D6; Sat, 22 Oct 2022 07:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425338; bh=Ku35vuD17YGpq0QHl+DAKe80YrZ/0TpL18rzyvhTdJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uewJ3Wn7SgpKex6/qBaepTZCYeM5dR4gfk1vQvflcZnmjOThCfA5ikinQ0pbskQdV OCbl2171FNyTqwDfb+lox9FeAoSHK3NazMDwfH069fSUjI3WaFLZTSbhbHYPJaRFzJ mT0WNGJiFJTKu36uAwJv0+30vooqA6UCW/MBEaoE= 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.19 469/717] mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init() Date: Sat, 22 Oct 2022 09:25:48 +0200 Message-Id: <20221022072519.057578490@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376185536387610?= X-GMAIL-MSGID: =?utf-8?q?1747376185536387610?= 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); }