From patchwork Mon Oct 24 11:30:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9635 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp532466wru; Mon, 24 Oct 2022 09:08:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70GKNBjZrXcNTHUwMHPwGoBgFwWyfwoHODQOlHX9jKGOThZkpiL9qDIkEYX0aEYqmBZKct X-Received: by 2002:a17:907:75c1:b0:79b:f804:c081 with SMTP id jl1-20020a17090775c100b0079bf804c081mr14997740ejc.381.1666627686552; Mon, 24 Oct 2022 09:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627686; cv=none; d=google.com; s=arc-20160816; b=xVoZWsJc3IFjklqJz8jOvWGOuC88s2z2MZe52hKQg4fqrNhPy/HvADKLBOCT8JJet1 j7/xFKvPcKZ1XgaB5TLZl935UTBd+oNhVFFkyU9ykFqC33QezdKSbQD7nWC4KQ0GWDSL jSYYSTkHH8firG82um7gaKz6PDr2FlrEzU58LOpPxxBAFqy7Z1LHzZVeNMW0i8S7dSmF HX+FScPxiRvr5VCnjiVbE/vVWDSRU8ci03S7dbatzLmRX9+huByGKkk9k4EipmextQG8 dlJ7l2bfS6mS4/kbZA3DmlSHQczpip/SvlEaNfDM/EkmS8CPn1YkfE7/82qz03lxLbps YlTA== 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=HLHWs2dA6rvzGSQ5UIqLxN/iAVAQLYg6sN9guCDGwdI3tUOz3xfNMxUQ2C46HNUDib 7WxeEcZXpfrCN81QReksWR8XNXieVAiNzDpzCvvyrAYUyPPbvQPtfVArlHN3/wTAqIUo yCW4QRW5bcXP9Ldkku8lCliY1H5DNXN/J/89eKiaf/8RJzU2sC+wWoUW08ZFMqwMYIM9 gOLSh8hzeC5JkGka75P1/XpA4x5N0V7rlMBI3tGoKPAdPdNK7FvCrQ+eB+FXA2PNe/dF uadpeurjcTcfXobTfn2cdmurmoGDqS64PwK3HzCuFGYDeTvf3sMPdJwEJ6yptU11kUpM +Esw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D9oJ8YHB; 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 h41-20020a0564020ea900b00447dfae6181si146499eda.235.2022.10.24.09.07.42; Mon, 24 Oct 2022 09:08:06 -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=D9oJ8YHB; 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 S233150AbiJXQGd (ORCPT + 99 others); Mon, 24 Oct 2022 12:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232977AbiJXQEH (ORCPT ); Mon, 24 Oct 2022 12:04:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64DBA11A970; Mon, 24 Oct 2022 07:56:19 -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 1BF60B81694; Mon, 24 Oct 2022 12:28:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74A5CC433C1; Mon, 24 Oct 2022 12:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614512; bh=Ku35vuD17YGpq0QHl+DAKe80YrZ/0TpL18rzyvhTdJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D9oJ8YHBs64xfPoPJ4ckppauB9TWXI/woO3Mam9LSoOAbTQ5d5REkV2oWXe/nVvy5 PJDZ/Qwj5hiA9z5DOLPgaX1RTPuPrKXhhfFPEQJjA8YOLUEIVOjyhC0YpMXTsM02jg ffZsY9AD5zQ4Xv2KgJ/g9warPg7KgxGKrz4jBJ48= 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.10 250/390] mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init() Date: Mon, 24 Oct 2022 13:30:47 +0200 Message-Id: <20221024113033.508191887@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747585793017504481?= X-GMAIL-MSGID: =?utf-8?q?1747585793017504481?= 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); }