From patchwork Mon Oct 24 11:31:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10176 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp640942wru; Mon, 24 Oct 2022 13:33:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM609Z4NLY22BKKcNjltZLx5p4B+tLkjr556fWu8qdIskl0I3iM8kQ/doJM9MEaabJVdgNAL X-Received: by 2002:a05:6402:5483:b0:45c:1336:6d9b with SMTP id fg3-20020a056402548300b0045c13366d9bmr32432265edb.100.1666643629220; Mon, 24 Oct 2022 13:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643629; cv=none; d=google.com; s=arc-20160816; b=jTS8xEdFGhQOkJ0sGRnLkzz4tSVv6mPtkqx4y0Inxk1wqIP8jsHdlN91kOb7wvPia6 KdVefj801cb01QVha1alc+JyiP7GhhijFXh3+BitzYus6zxtqOU8tNjK7khAGMDg/0Y5 6ELlHiQJzRIyydsiacjixaizwrbOCGS2Z9CThp6R63wqU/1DEeLi6bC2Ji9f4PQGH1Dl bfutNLEUotMLIxuqXveSUOCahUalRpTmg+Zr2cJkxNIphMqQfsXi3dsQVSBwPwJgaAJw VSueF88U796Ys9x2PgFJL1Fr/3AqR4pRFLg1jLBPCPXPz7tHW2B0e1hAV0Yjjtffu57r Ibdw== 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=M2V7W3OFf01DcmguN0q3zt7bMLKA2JPTuoJe8v98bxg=; b=u0l/1Iqt2RC2aHuSYKrRzNPYFuq0cwsOhCUfVGV2V4vTgwrkfhtF9xrhuPZjvIunYT F/j4IkIdh2CTuq/D7CGezOKFSr8g3blJLCXbQtwqLbwN+nWXyU5uWCJX71FMpBDTzHe7 I6utnXTBY0nMk4txJAvR4iT15YJk01a1nhsRHtFWGw56At6gCNuQTwb8TYkQbReDHOD3 0jle/u8aRdbiCRCREr407YB8mDgZlVbgN7G3YhDT4j6caQNXeHxPzCNXfqoDt2TzobTc sDoCBREyBiIGbsL4pAKfu+zscgQaYOZEPmHR82qZYC7OhrsTnWaImQ2miwoEKz5mnvKu 3TQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="l/pJl072"; 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 h19-20020a056402281300b0045945eed10asi938123ede.5.2022.10.24.13.33.24; Mon, 24 Oct 2022 13:33:49 -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="l/pJl072"; 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 S234262AbiJXUXV (ORCPT + 99 others); Mon, 24 Oct 2022 16:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234272AbiJXUW3 (ORCPT ); Mon, 24 Oct 2022 16:22:29 -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 BDD603C169; Mon, 24 Oct 2022 11:38:09 -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 E8B0AB81601; Mon, 24 Oct 2022 12:13:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44693C433C1; Mon, 24 Oct 2022 12:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613581; bh=hc8c3MQUf/iJKjMeBQ8BrGrAjXnopkSr+laGHJAs9m0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l/pJl072FBIJfng1DYeWtYSiXJHq5vbyItMe0bkOwcNGzpgNWAU0lVedMz4I5IX5e KswZYSS3o1taMEm8eAr/FOPbDm6Kd1/GJw4HHM7qvFwX5wIA8jo212s3vSq5GpTlUT vxikNmEWjTiLTXPZdMzFlfnrK2xv/B8lJbiCWQDc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Martin Kaiser , Lee Jones , Sasha Levin Subject: [PATCH 5.4 161/255] mfd: fsl-imx25: Fix check for platform_get_irq() errors Date: Mon, 24 Oct 2022 13:31:11 +0200 Message-Id: <20221024113008.040133654@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?1747602510319914001?= X-GMAIL-MSGID: =?utf-8?q?1747602510319914001?= From: Dan Carpenter [ Upstream commit 75db7907355ca5e2ff606e9dd3e86b6c3a455fe2 ] The mx25_tsadc_remove() function assumes all non-zero returns are success but the platform_get_irq() function returns negative on error and positive non-zero values on success. It never returns zero, but if it did then treat that as a success. Fixes: 18f773937968 ("mfd: fsl-imx25: Clean up irq settings during removal") Signed-off-by: Dan Carpenter Reviewed-by: Martin Kaiser Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/YvTfkbVQWYKMKS/t@kili Signed-off-by: Sasha Levin --- drivers/mfd/fsl-imx25-tsadc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/fsl-imx25-tsadc.c b/drivers/mfd/fsl-imx25-tsadc.c index 95103b2cc471..5f1f6f3a0696 100644 --- a/drivers/mfd/fsl-imx25-tsadc.c +++ b/drivers/mfd/fsl-imx25-tsadc.c @@ -69,7 +69,7 @@ static int mx25_tsadc_setup_irq(struct platform_device *pdev, int irq; irq = platform_get_irq(pdev, 0); - if (irq <= 0) + if (irq < 0) return irq; tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops, @@ -89,7 +89,7 @@ static int mx25_tsadc_unset_irq(struct platform_device *pdev) struct mx25_tsadc *tsadc = platform_get_drvdata(pdev); int irq = platform_get_irq(pdev, 0); - if (irq) { + if (irq >= 0) { irq_set_chained_handler_and_data(irq, NULL, NULL); irq_domain_remove(tsadc->domain); }