From patchwork Mon Oct 24 11:30:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10141 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp638163wru; Mon, 24 Oct 2022 13:26:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7MN3o+dtIK+gx193vKBCtosJzi1EjnDlITP3bzAjm8ARjoImv5dRpSYQWYEOvg2VYcOpMC X-Received: by 2002:a05:6402:51c6:b0:45d:50ef:1142 with SMTP id r6-20020a05640251c600b0045d50ef1142mr32875428edd.259.1666643168562; Mon, 24 Oct 2022 13:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643168; cv=none; d=google.com; s=arc-20160816; b=MS13iOWmiiUhyHUBOvCJtgVTQwf6/1Kx3UDZfl67IhkMMN0vF8pPlSrZmvAaDia72R 7teh0tS+GZmqoS4OJVtcWm8veH8EXYYserxh00TKGRyVUquhw3CxW3MS0BaeMKEkZIpR LQeYMPOnZCVJm23zTawX1Evf50bc21BXVzy2rvvktFvDLgieWCQk2Lv3lTmhWabi+1I8 bfg4SRwVGZYaiuiT5EKPGWC59vnshzh4iTk2ReCJ3aM2vga4lQyTydhtyTTmFU6T1/24 OSj3PZGieaI+R5ht32i6B+9flhEZvsx4aWHKP7VgUiFHINU80F8AxpzZfClu0lVvEqV9 DdSQ== 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=JXNtLrKkyw5lX4wQBKrnA7QL2LIG8WgMWw+6TYXYPKvIFWb1HJpyCj+vuCRx7PBXxv A6timF6ZYy/hQDa27X0cqDlsC6z7OMEDZKIRAvO7vu5m3ARywuzag7NmCh47K/V2Ti6U TskFUFJpopZu2ONni3E7mjWpeGI3R15TqKdk3kU61asEFNBUxehIqi5tt59dn9gWyMpk c79WlCw0Z3oI6HPIuXYgyt6ESh8mY7/yewt0qncVpOGDZR112RjN3wiASn7C66Y8PAPK qyMOtwJ8+ZQANB8WChHgjMg5+/dw3Kaomxq+T6Kg+EFtR5gqDfUQF7z3fF1tR29m4ejQ sklw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rrRsqRA2; 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 h5-20020aa7de05000000b00453b9f11b56si598987edv.261.2022.10.24.13.25.43; Mon, 24 Oct 2022 13:26:08 -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=rrRsqRA2; 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 S231239AbiJXUOX (ORCPT + 99 others); Mon, 24 Oct 2022 16:14:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234030AbiJXUNy (ORCPT ); Mon, 24 Oct 2022 16:13:54 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 727EC96214; Mon, 24 Oct 2022 11:32:13 -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 sin.source.kernel.org (Postfix) with ESMTPS id 51715CE13CB; Mon, 24 Oct 2022 12:27:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49E6DC433D6; Mon, 24 Oct 2022 12:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614431; bh=hc8c3MQUf/iJKjMeBQ8BrGrAjXnopkSr+laGHJAs9m0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rrRsqRA2f4kONVl2DAcyrtL6RioxgYHYzjHckchlO0jHD57P5Wkg3U1mj4Qrjg2Fi do3O52aOV+5kWMopnYs/Mwpx8aIPAUuWo1mg4pZPrZWOxmRqA85xw0Ww3EwGowV6p5 H8LeUI//mWEuDPfCh0vhG0IL0SMpU9qiui4Y/mC8= 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.10 251/390] mfd: fsl-imx25: Fix check for platform_get_irq() errors Date: Mon, 24 Oct 2022 13:30:48 +0200 Message-Id: <20221024113033.556644401@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747602027101810633?= X-GMAIL-MSGID: =?utf-8?q?1747602027101810633?= 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); }