From patchwork Wed Oct 19 08:31:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5416 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp315985wrs; Wed, 19 Oct 2022 06:07:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4RGdyOqb3sk+DS/VfSlRLXn/ofv/fn8njuzk4HmWLXbqtPi1S3WqCs9Foje8czrqtnSMnj X-Received: by 2002:a17:903:24e:b0:179:b755:b82f with SMTP id j14-20020a170903024e00b00179b755b82fmr8106331plh.34.1666184823944; Wed, 19 Oct 2022 06:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666184823; cv=none; d=google.com; s=arc-20160816; b=jwQsDoN3CGKIR5NTE7K+FtKbYlXn+mIiWuIBzic0zBKhFQA2X2A/zvjI++cutYwtLA uxAFEUuYpgi6Xus/lY3ORIqG2jWMSQZqa3qTfu15QTdiIl2trTwP+BS+aAEM7XpVkuCL UdACAiMsWAiVDVjCD6+5+iz9ihFXcPCe4Oa/94wfnHthetsUgbJQrFnvzZlRwEKwZeCX 0Bac2g6I0hKQOHlN7EOCVQMau2yWZhaiVZZDVMTB6EfkzjISCDqukqBfHYsNaTTZriyH OyNd4BHCRjhn5MXIqChL8ADVsabucpKUXUqnVAgZTfU63XsMI/6rloPQDbp3C8vID9WD xm0g== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a170902e41100b001786830f52asi15565831ple.308.2022.10.19.06.06.35; Wed, 19 Oct 2022 06:07:03 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747121418261016985?= X-GMAIL-MSGID: =?utf-8?q?1747121418261016985?= 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); }