From patchwork Wed Oct 19 08:31:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4896 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp225531wrs; Wed, 19 Oct 2022 02:43:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5C8RhWWpc8e9IrSPZ+Yjrpc0tGJs0GnWORUlW3HrLAVpIoGJkz72pZb2CiUM+XCjdKiodh X-Received: by 2002:a17:907:1c28:b0:78d:4616:e6b6 with SMTP id nc40-20020a1709071c2800b0078d4616e6b6mr5672589ejc.257.1666172601521; Wed, 19 Oct 2022 02:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172601; cv=none; d=google.com; s=arc-20160816; b=GcyJ/6PY9bTWtJGFhjgNGXJTGAbe9hZTub+XKFCV+j8afj4+dl8cz7a4WvOycQ9CRD oOgp8LnUZ6mn4FtSsJcKlHK3jgngxAlYuxRz4PVrdooO7Gwqdttpfx7XK2nWBCCs1dhK jpRwecfdzZXBHuhNr03q3fy5W+9Yeejw94ETMJDh7a8cxULZWM5GZBQsVSIOmAppclEg oZqUBZk8xIFokuUDWm/CvdlLrGCzv3m5lE9k2HtR1oERPeb3JZZDmHop/xcHK5dmPV7V +4GHHT5RPiPq7rkuzkckXadAeKh65/rL7zHTl1orDw8RwedHchUQ/Kdhb6icDJNnomSl J61w== 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=0ATPCS8Y3WjRgGflB2uOFybiEyvctPzj/oV05yt+ARo=; b=eT6ZOOQyr7T1d8RIa9ZZujthiO30DY11YLcwCSB7pS56fUUjr1/1whGThEEwdI19Y3 2yo2bNrvPl2/BVefdybKEkoXzYYnaeQPM8RdYpbvXQgoYNMQphZy3AGtPbUAHEnXQZ3x jdedRsgD8NRUt5B7/FN74cl6AZ7k+CsUvFanUzMbA0O0sdcxYWaObSBGGl+QItsfzf0z KboW3jKmhITw2CwmKROdIf7aCGlQttc4CiyV0KTI1G+FxkEwjtoFNpHv5jjGopZ8VxBH 4yYFA/Ts+wYoI6ZrGXWORNOCQx9qGm0Oya9FMOo0JAkeP5hwNMnodPczXcQfFVRh+e2U oJjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RE4wFPHl; 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 hc32-20020a17090716a000b0078ddd8656d9si14806648ejc.9.2022.10.19.02.42.56; Wed, 19 Oct 2022 02:43:21 -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=RE4wFPHl; 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 S234026AbiJSJe0 (ORCPT + 99 others); Wed, 19 Oct 2022 05:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233785AbiJSJ30 (ORCPT ); Wed, 19 Oct 2022 05:29:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EF0D6BD57; Wed, 19 Oct 2022 02:13:02 -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 74BB661857; Wed, 19 Oct 2022 09:03:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 808E7C433D6; Wed, 19 Oct 2022 09:03:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170235; bh=qWqlig6IlzpHHxfd14zNaM8RXMalHFwmu12oJV+HDCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RE4wFPHlsVGZWDPYocoyd2cwcSGvp2mmdHwwl8niUJWKFmr8dPWpQqplnQX8V/X2/ QfPYC29kWS4Cc3rX678ZDj4EBEiXutqQEEcGh7zoc8C2wSkVE2BeQ087V1xw+0o2gG mm2iledHzDt+Ppx50Z8OC+yFDKA4m2NfIL2VCydY= 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 6.0 578/862] mfd: fsl-imx25: Fix check for platform_get_irq() errors Date: Wed, 19 Oct 2022 10:31:05 +0200 Message-Id: <20221019083315.496182277@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?1747108602024447787?= X-GMAIL-MSGID: =?utf-8?q?1747108602024447787?= 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 85f7982d26d2..823595bcc9b7 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); }