Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp316868qtb; Wed, 19 Oct 2022 02:44:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4f0N627SJ7wYdDN3TBK3KTqWtD4C5EfoY/ZKBO8QSQF1USf1UQj4hMi+7i0DjmJZ+7y9Kq X-Received: by 2002:a05:6402:8cc:b0:45c:a5c9:c0a with SMTP id d12-20020a05640208cc00b0045ca5c90c0amr6477176edz.135.1666172674925; Wed, 19 Oct 2022 02:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172674; cv=none; d=google.com; s=arc-20160816; b=qpZdARgLZpvd07TkTSBic14OO4q0E/BjUBHHkRup44+I/jT7gwvQmjzks1lAO6MIfo mjahZXSX/Dt6dvQY8A2U8xP5BvYu/Xu29BmmKa7uMux6eJuG/rxbP8WO25XQn1WholsT 1T9zlRpUNKUtsnhlaUWnLJJMKpzFW0LrT53yTKlhaOSFyGZpLbc4VpZh1ctsIQt8AjKb mHrw8EzneHiKsKS8FS1hk/ssz2x4ze6mQAL4cjjf+FRO8XzQjuN/rJ/BWTxdx75EDjdS X4rzdVwrrCgutBlxlZ88QquFnOkWch8nwB7si6Fz1Uvtjh8cfBb6duUKF/Le3v9qTbJY 14Bg== 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 Return-Path: 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.43.54; Wed, 19 Oct 2022 02:44:34 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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); } -- 2.35.1