Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2183620iof; Tue, 7 Jun 2022 22:28:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd1lrrRLpUoIykT668VXYLz+44fV6BgGeosVQyd9pr5zrhXhsjWTLMGMTRRQ+UU1Pvfpuc X-Received: by 2002:a05:6a00:1f1a:b0:51b:fac8:e00c with SMTP id be26-20020a056a001f1a00b0051bfac8e00cmr19758385pfb.26.1654666118468; Tue, 07 Jun 2022 22:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654666118; cv=none; d=google.com; s=arc-20160816; b=cD+0R5d2cXyfzQM0UdTCNX1ZRpnt4y5YcCrPJThQyHdhwud1+U0Ihd6Jd/hcFFeCcF zVy1RUtbCIRalrPHVeyrJd8zeHXPKnqOPK+S3mragy3LeKkdPLBQltiMdI00u7c9JDen PE8RwvvGaP+LMZ6olkukQtbZOKC0ZGbUKXLEmP378RiAJX/C/FI+shCzIf1vhZpnskxb 0+i5GUVZ3xEf1mb6xSWett5kDXLqksGjwU1nGPhK/B/XKSShRE3VB953W7VsfN5SK5bG 3/XhZc+E29yjTpXAZxFOj2lYx8Y2zRzawKljkXw5h6+L6P2tyQUb30Nhfu/y2ds4nXg8 rD/g== 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=L+2Zxt9ItOYjprCQ7LsIdIy/kPgM65vneOqD3b3Lt+g=; b=FzaXWVGvahNwjeGSTkocgubYlsuwmc3U1klCPLtzki3ph3UQ0FhILLMAzlvkLkiSU/ CQW/zPSQuygTI0PR349qxL2zraLaKm0OItGi/hf/S1p0A8OLXXe1nvFIGFV1tAAEtBrX 9wwy3rOUjUfbrFVxEIMmYyU71Mc6EVnw522o0666ojmT4grWlHwdya/27UjnxFy1uhTE 0r6g7gT8NNuFZJ75Od1SCp0TrL1Slhs3iHzkQNzO/IknPqzRDa11rpM8iErdl0DBsgH6 u7K2AeMPYGMI5RUOp0ArH7qwoq6O2EOL30XH9vdm1/7hcAZ1rX4WBMroi8viTyFrWbBd NWLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wUyQJr1U; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b64-20020a633443000000b003fbf9fb1fe3si27729373pga.98.2022.06.07.22.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:28:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wUyQJr1U; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D37DC29423E; Tue, 7 Jun 2022 21:54:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348902AbiFGR4j (ORCPT + 99 others); Tue, 7 Jun 2022 13:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347758AbiFGRfq (ORCPT ); Tue, 7 Jun 2022 13:35:46 -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 35B6B10A606; Tue, 7 Jun 2022 10:31:20 -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 E49F9B82285; Tue, 7 Jun 2022 17:31:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 380F7C385A5; Tue, 7 Jun 2022 17:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623077; bh=cOVRoMh2dOk7ICQ8DdAnJhhYMLLUDecgkUZ1B1A+j5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wUyQJr1UAH/pmxgDG4Syjk9wK2Wb48asdzRRDklMg+46Fe6hdCbY/ifzREzHsR93/ 7YFPZs1Waq4PsChZ1T01OLYaXLkomDwpzSWbikLge/CYlasczZDtIz1v4JNioDTpEv H3nJrjaic8d2iEl0nUP7N3m1wQkhFsYp6tdKS9pY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zeal Robot , Lv Ruyi , Linus Walleij , Lee Jones , Sasha Levin Subject: [PATCH 5.10 285/452] mfd: ipaq-micro: Fix error check return value of platform_get_irq() Date: Tue, 7 Jun 2022 19:02:22 +0200 Message-Id: <20220607164917.043560760@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Lv Ruyi [ Upstream commit 3b49ae380ce1a3054e0c505dd9a356b82a5b48e8 ] platform_get_irq() return negative value on failure, so null check of irq is incorrect. Fix it by comparing whether it is less than zero. Fixes: dcc21cc09e3c ("mfd: Add driver for Atmel Microcontroller on iPaq h3xxx") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220412085305.2533030-1-lv.ruyi@zte.com.cn Signed-off-by: Sasha Levin --- drivers/mfd/ipaq-micro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c index e92eeeb67a98..4cd5ecc72211 100644 --- a/drivers/mfd/ipaq-micro.c +++ b/drivers/mfd/ipaq-micro.c @@ -403,7 +403,7 @@ static int __init micro_probe(struct platform_device *pdev) micro_reset_comm(micro); irq = platform_get_irq(pdev, 0); - if (!irq) + if (irq < 0) return -EINVAL; ret = devm_request_irq(&pdev->dev, irq, micro_serial_isr, IRQF_SHARED, "ipaq-micro", -- 2.35.1