Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2193350iof; Tue, 7 Jun 2022 22:47:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5UbiLYQREUzdSO3D4Wq4zAT9eMAzL7TdgcfiACzaG0fj3JPwZ7hJ7iueHIJPIMK5FsTxT X-Received: by 2002:a17:902:cec8:b0:163:e4c1:b302 with SMTP id d8-20020a170902cec800b00163e4c1b302mr32684389plg.123.1654667221833; Tue, 07 Jun 2022 22:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667221; cv=none; d=google.com; s=arc-20160816; b=Xeex8JWHxcdPxhAh3TVobADQ+xbltJt77/5WdagEVknNaNAy94TqxuhD4tE0PeQLfV pHfU40D7PWiKG719q23TUTllxohleYaBhY88xPC6N3/qspSx1/NXHgDl7atj+KxyWUFR r1J2ZmS3D/TmEVAj/KaT4Adoulw+ejCIcRZVJ6iI4KtClCH/F3oLgwfAT6iRKbE4h58G t65wopivJxaxsQNekAkuC7gQhlpBPWgiLwX19ZEMC8+GCeenYOLAeTY0XLMX05urSzMl lfDEHKvvVgCeaLccOEhqtzsJFeqIUtWlTrGHUpCjyo2HuwAe0AQCp5Wu2HQP/x77/4sF XPAA== 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=WvikTunAPp0I1V+8QuvwuUEGUGDADcmMKUs2U80PInmj3CMbkL9UlBi7WUwwHjMmHJ a6mpg8m+Osu+MiWYhh7tkxHGzwZ4k3F1HBqqKUeyJVIZ8GCKjzGjyJn97yPzCH0X1A8z 3Om9095+bI7MbNUTolfhWIfdzd/bUrk+2v/EGSHJTnvtCJNQI84jm7pqdHP2zcdF71F5 iG0leQ+Foy+Edp7XjZIK2zkBQhykel+vDvxfPCZRZJ2nnUU7tc6OvSw/Oi69LPWZsB/O kCLGnvMz4kwDw7xoDWQp9kZNHzz5knBqKJjpWN0TIsHajOefUN2jlERuhaJYh4c/Wk6G aBEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GslKsZFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id kb12-20020a17090ae7cc00b001e893b0bd67si8476155pjb.182.2022.06.07.22.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:47:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GslKsZFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 F2135F8E6E; Tue, 7 Jun 2022 22:11:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376497AbiFHA2e (ORCPT + 99 others); Tue, 7 Jun 2022 20:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383785AbiFGVxn (ORCPT ); Tue, 7 Jun 2022 17:53:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ECB1194250; Tue, 7 Jun 2022 12:12:27 -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 C3B88618DF; Tue, 7 Jun 2022 19:12:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5F88C385A2; Tue, 7 Jun 2022 19:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629147; bh=cOVRoMh2dOk7ICQ8DdAnJhhYMLLUDecgkUZ1B1A+j5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GslKsZFEs5OAK4m7Dm/6rgDtGipUYifAAMACQakQRJVmKtF3aHSD5GIKXnH6xIKRW a9vB37F4ff+334Hq/Yfx+3WLo6T7BeYptOKwjM9+xzX+8tNnWjtZAOOhMJAo+7QQVF SWllQO1oOGtm9Hjigq2Ta8D8LM56QgDK7UB5x6iE= 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.18 584/879] mfd: ipaq-micro: Fix error check return value of platform_get_irq() Date: Tue, 7 Jun 2022 19:01:42 +0200 Message-Id: <20220607165019.804119736@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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