From patchwork Mon Oct 24 11:31:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9441 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp479393wru; Mon, 24 Oct 2022 07:19:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BOkCqVl8/8Bvmu3yPHxa2iVTXHJ+AlqZCNQfrNxbDXQgA1mC+eluQFsrsxmmkK3DvcL/w X-Received: by 2002:a17:907:16a7:b0:79e:9eed:8f6 with SMTP id hc39-20020a17090716a700b0079e9eed08f6mr12753033ejc.731.1666621143931; Mon, 24 Oct 2022 07:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666621143; cv=none; d=google.com; s=arc-20160816; b=0AFEiK4EfTpZrZz1+2nh9p7MxcAwcMjF0TU/hWnEepaf06i8M4jsRJgCVtoDHMEVZi 86cSOB33OHZDTiOZxMkGNDiO/931Z6zPqTMdb1l07ZjZQWt1OYML8HbEoTQkSQO+FJU5 gjZMUric5XD9YcMUshZVWnyUDI+L4d4IuPI4qgpzzRhTmfdD+Wk6xiU5t5T+xSj+Wgca buc+2w2sGt7SGWs8MFNkDNyzFXNO3BJgpSXI7P93sX1aY0cKZSmYMkwulSCjqp27u2K8 VKU6WKWSQkzH6iLI42cVYBuNP7T8V7n0BCwfzMbeYWvUmn61/o2BZnLHzysOZroRRocx lHWA== 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=EHmWyNaGuDZfLTjl9rqCy8Nzc9KYftDS5oVx0caJJDpGI8KlW4QdNJcQal1dd0h3hw JwdaQ5us1gmC5o6zhgsYqFLH9OcV3s9qnp40edBc1iul5PyWUks05tN0zSZOME8LFvi4 Q3ssxys0kw9zyK37vOzn4ti6jkmAfRhtsB7PgHwuzB302rvG++9ZdHgaDDv6QVKmzjlp pie33PuJdwpTt7Ka+9T1fMvlnkPfXWLzKT5EZFKsm5Q3QT1wQ9Hkv0L3NwAbChpZda4y F98R1vQoYiulACLbSlA6g5TZQ0pT9eJqqt0hVC5tXfGiEZ3lauyhBVsUxiX4BVStSn2m hfGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vbnriwTy; 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 l1-20020aa7c301000000b004612915d1a0si9842058edq.507.2022.10.24.07.18.37; Mon, 24 Oct 2022 07:19: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=vbnriwTy; 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 S232492AbiJXOHJ (ORCPT + 99 others); Mon, 24 Oct 2022 10:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235211AbiJXODL (ORCPT ); Mon, 24 Oct 2022 10:03:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4243AC09BD; Mon, 24 Oct 2022 05:48: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 dfw.source.kernel.org (Postfix) with ESMTPS id 2E6D861331; Mon, 24 Oct 2022 12:48:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B027C433C1; Mon, 24 Oct 2022 12:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615681; bh=Ku35vuD17YGpq0QHl+DAKe80YrZ/0TpL18rzyvhTdJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vbnriwTymFmptiuJSEVTHaUx0wrY8ZEsPAJ4fHiCiKKu5i6J2xRSYQlqF13yaGzk+ veeXzj8OSBExRQUxKiNm5uIk5IE7n+/MGBMicFM8kSfJ/dFtTcTm0S2cLhLB6l/Qy0 7ao3cv7mISIZZ9vQnBv0gkfmgLSR7/DDnKzIQTuI= 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.15 344/530] mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init() Date: Mon, 24 Oct 2022 13:31:28 +0200 Message-Id: <20221024113100.576561428@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747578932254586755?= X-GMAIL-MSGID: =?utf-8?q?1747578932254586755?= 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); }