Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6138578iog; Thu, 23 Jun 2022 12:09:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vPIuU2ym3WkcyB8uRESu1qxVjDn6JmEDui81JSZ/bs6MfNcCRriRlj8OC+IDhqUP+8S+Tz X-Received: by 2002:a17:902:ce83:b0:16a:4663:f34b with SMTP id f3-20020a170902ce8300b0016a4663f34bmr10110468plg.125.1656011342015; Thu, 23 Jun 2022 12:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011342; cv=none; d=google.com; s=arc-20160816; b=z71V5oV8rZUKU7vrOqPW7hj2B+5WN/x9FRqLiR+FXHdY6ulkM6knwIu3QQKQ93Z7hU I0/Df/vGXVB+DDsUu75SFJCHIMgbypeXvvoMbvIlV9DI5cElFnnysJrL4Gi4wgRIMefM /lAEMfe4C7FgoppYOojefKGzsGuW1gieKu9ZBrBvkoDj2TfsV9tPOj4ftWus0O6rp/5B JI3capqytaxAbHUM7LxJf6KuNzbJOv4HUKpfSIWpKP4XlCepx7GPXr7AwUvaAqWyKh/v QyfYHBttWq88yeA+5uRR7D+tpdk0WHgrX8GeNyrMPlm0Il5FV7SnBRvDz394joTjQ4tO DTFg== 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=hl1MKL1SVOCbqbvLtvZGvFeEDjWl7hWHSrbBHljdr6M=; b=E67K2pIW/bS8zAM5Eqi9sUk5cWEZ1cTutxf0hu8zcQedAeyKAd8QPnhzknN8+C+OSi uai385uBjMCaKlPvk2s/DVJ+VcPBBVtW27D9OxU9yj+nvzN3/NSTfrh/4I6fT3DE4mOw CMWr53j4l2uxDESXqnTrSr9t0hC8xpik+DLQOzAnqSw85CHz04ZvcjeDc4MldivOmkfG LXdfkiQ98CJRrkcpx5LTddK2aj9yHOX+I72+0R+SFDzqwq1aZCEhu2BdWev3uOuZbgYh 8iKpxYqO3YvZDeQBC9sj/WgNLB8g4Bq1/Q0JL+u5gPbOEM5FkuHfdJL1ds4Q3lBhRl17 tUlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j3ooKdaT; 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 b5-20020a1709027e0500b0016a4179aec5si335648plm.361.2022.06.23.12.08.50; Thu, 23 Jun 2022 12:09:02 -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=j3ooKdaT; 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 S236911AbiFWSRF (ORCPT + 99 others); Thu, 23 Jun 2022 14:17:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236242AbiFWSQO (ORCPT ); Thu, 23 Jun 2022 14:16:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A2D5DF2E; Thu, 23 Jun 2022 10:22:38 -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 A6044B824B8; Thu, 23 Jun 2022 17:22:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F1F4C3411B; Thu, 23 Jun 2022 17:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004955; bh=VG9aNFZYJ478pGSL1Jxp0aHvd6Ym/bnNuXeQmfupP00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j3ooKdaT3wMUIOEC0w+w36uvJm/FFU3lCRlcs3I007Wcixf/4oeh0oQ351MD2xTWN TRF2qSz9nB5yVanzz9n38bN4kdZ50CUVXlx3U9P+rBban0e5RtYtR2kQUQHI4ATGhI 3XXbIU3Liu4ir6acp3mwYWQ5sP8AYYaTyWkGgbAw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claudiu Beznea , Miaoqian Lin , Sasha Levin Subject: [PATCH 4.19 203/234] misc: atmel-ssc: Fix IRQ check in ssc_probe Date: Thu, 23 Jun 2022 18:44:30 +0200 Message-Id: <20220623164348.795607710@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@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=-7.7 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: Miaoqian Lin [ Upstream commit 1c245358ce0b13669f6d1625f7a4e05c41f28980 ] platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: eb1f2930609b ("Driver for the Atmel on-chip SSC on AT32AP and AT91") Reviewed-by: Claudiu Beznea Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220601123026.7119-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/atmel-ssc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index f9caf233e2cc..48521861beb5 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -235,9 +235,9 @@ static int ssc_probe(struct platform_device *pdev) clk_disable_unprepare(ssc->clk); ssc->irq = platform_get_irq(pdev, 0); - if (!ssc->irq) { + if (ssc->irq < 0) { dev_dbg(&pdev->dev, "could not get irq\n"); - return -ENXIO; + return ssc->irq; } mutex_lock(&user_lock); -- 2.35.1