Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp445530iog; Mon, 13 Jun 2022 06:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNLfY1ftAZHxzuFiQYkhwgo25r/h9vMoWpsKaZIPhsAVdkw+xyELHbgMH3p8zMKHFpMRl1 X-Received: by 2002:a05:6402:1d4a:b0:42e:93de:17f4 with SMTP id dz10-20020a0564021d4a00b0042e93de17f4mr57186301edb.8.1655125697436; Mon, 13 Jun 2022 06:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125697; cv=none; d=google.com; s=arc-20160816; b=ae8dLlf+97Hk4j7h0PHEmKlxUjYexWqNWDU0UrRz+5qkCwv8VreWYB7yawLa0eEcMJ qIvGrrs5Nw2aCDeq/SkHPnZtIdI1bbFOJv5C03hgZPh10Gu2afnslqCbub1IPdwFoJW/ 8BEB1z7x/10n9Cpzt4c3UBvtwi2jm9y7x4fYUS+S54gxv1TnvNJS62WWC5t78ug+ekXq Bviq256TDALPtEqniHuaZn+F3M1mAxereGbrLl95pQ6kBQS0TVopaJdFhanmzhpEs6F6 /FxcG5mb7yEssuK4lemwkDMBwGqeSZonweUm78hirelhB7hA20OtKR5DGDWIpaET23VF eqeA== 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=IxhP8hpj1fmdqcX4zBbQ0z0Ldcw/rmEELSqD+uzapY8=; b=HYyszdVR7av1CVKfCDBH7ew8HDklRPipp3dNfd1zU9GQY6l3gfU43x8Zo4i5EzgPNc fD16DUf9PzJesib3HiaaUa/0I/JY4NjRY8ldO0VWCWorJypGgGqL8Qf6QnHpCCevaRUw 1enbz6ZyVtT4KqyoR4qKOFyIeZLHPAqPU9y+pMVGjR4Za2wET/j5XCL4uAM5jT5RZfxC TAxgwft8uiUQeUwgk67q1EDqfky6KhSvHwIy4h3fe+tZr7kT2NmEECsZLtZTbHvs0gt8 PSigQ/WLQZ//1pNm0XM0brfcN0KmW5GyHhofjbAt2TGXX1PMmkpAam85oE5Fx//42Nhx eZeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yOTFjIFv; 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 m20-20020a17090672d400b007121b9fc6f9si6809881ejl.954.2022.06.13.06.07.51; Mon, 13 Jun 2022 06:08:17 -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=yOTFjIFv; 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 S1347843AbiFMKtF (ORCPT + 99 others); Mon, 13 Jun 2022 06:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343978AbiFMKoo (ORCPT ); Mon, 13 Jun 2022 06:44:44 -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 794102B24A; Mon, 13 Jun 2022 03:25:39 -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 7837760EF5; Mon, 13 Jun 2022 10:25:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8740FC3411E; Mon, 13 Jun 2022 10:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115937; bh=YVVPUSoDaXsYIq+Ui4oa02D/zRSv0Ui66rsUZ8ecm0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yOTFjIFvO57CV5aZsmfHXeJGGjbAMYSCFhpMLyvlWKgLpYGxYPsEjZ864SeK8MT6E 473cNFTzVuLBc3E8PXEro1izzCRh5RIke25sQ7w+YwPpVCTbtk+VG32wdOgUnUMHkd thGJrtDseOkCKEhj20Xl2UwLKhYTTWX/jh1bnWWY= 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 4.14 085/218] mfd: ipaq-micro: Fix error check return value of platform_get_irq() Date: Mon, 13 Jun 2022 12:09:03 +0200 Message-Id: <20220613094923.106580220@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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=-8.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,T_SCC_BODY_TEXT_LINE 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: 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 cd762d08f116..2ba0e2d575c0 100644 --- a/drivers/mfd/ipaq-micro.c +++ b/drivers/mfd/ipaq-micro.c @@ -410,7 +410,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