From patchwork Sat Oct 22 07:25:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1105089wrr; Sat, 22 Oct 2022 01:34:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6svXQRPluk+q6fQFZJazM6PZuyNGrOneosFrHqAu1GTHlNaUmLJBp+qwRSF2mOs7tbRjay X-Received: by 2002:a17:90a:54:b0:212:eb01:1ce with SMTP id 20-20020a17090a005400b00212eb0101cemr945893pjb.236.1666427645582; Sat, 22 Oct 2022 01:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427645; cv=none; d=google.com; s=arc-20160816; b=NFMRuTxv1WTY6Ubcyiqz6gnE18OGf08FKeHA1iJ2tQoVDTrKpUzEkq69Es0aN86B6d Z3/B0mFd4GPcHqVbm4kJUeQQx/ua1oxsBnWfloW1SHtshPPqMRWujK/1440nDy80SIXF 5tJg1xXcRkJHhESI9q5lh7JADz7K+BJH8adgLG5o8mJ7vek82fXfohq6mUWZn5OCyYck s9PeZ3HQw3pMBsKRzR2/GM8Mink2uk4K8QRC4RWBbbaJLVv3QoFPfOOzJjQMhoygH8Qh HZlUFFpNGBXO+/Odu48EmDUWUjKp2bfUAV7QmTZr9U9/41kvR+GcwxKwNtpeGYGPHM92 9RDQ== 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=D+kO9EsJ5fz6hjb5o7W6vr8EcYgOySpfw/COkewvTYNtgNkGxAPrP3VG8Og72ZkqHd LVKGcqzDQSdMcZk9cOUUTedJaV1mo2vR1pSW/AX4FG/z6Q4MDUjtQb1ySuoTVsEM+DiV sT0wp3vXyWbUs8eFiH18vNITWJNRviWYTCJjdr+Af1m8YtbILngyIj73sY9DUvA9Rp86 a4eEUCTCD/N/F8Dvxh9j2oQGc7iCu0yTtMtpYTaWXpx7Bm8u3Xs3V4of/oY+n8ibI0QY vtagVXthxih1tpXlSUm5gaRS2Yp/o8XVi32iSa7sGGPk6M8DNuy8zWpORsqM9+gu9H7H Jlqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SrFoW4Jd; 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 lk18-20020a17090b33d200b00209a3e49f63si2293654pjb.94.2022.10.22.01.33.47; Sat, 22 Oct 2022 01:34:05 -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=SrFoW4Jd; 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 S230012AbiJVISD (ORCPT + 99 others); Sat, 22 Oct 2022 04:18:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234019AbiJVIP4 (ORCPT ); Sat, 22 Oct 2022 04:15:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73C54D6BB8; Sat, 22 Oct 2022 00:56:49 -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 3FAB960B9A; Sat, 22 Oct 2022 07:55:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 553A9C433C1; Sat, 22 Oct 2022 07:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425341; bh=qWqlig6IlzpHHxfd14zNaM8RXMalHFwmu12oJV+HDCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SrFoW4Jdl8k8BSJD3i9rs5Agt3Tp1z/IbnncKCVggjORPEv9te7IOua/wxHyLxQ0/ Lyijjxp7H9SH76FicCNJ3+EFX6F3rvRNxKYCrgjPIcjWlj//9sNKlD31ii2UYXqt00 lpJbpMX/bDU0vYiI4ZkNVFVcEuDYGIYl6wUP8AXg= 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.19 470/717] mfd: fsl-imx25: Fix check for platform_get_irq() errors Date: Sat, 22 Oct 2022 09:25:49 +0200 Message-Id: <20221022072519.112847638@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376034963072823?= X-GMAIL-MSGID: =?utf-8?q?1747376034963072823?= 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); }