Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2931440iog; Mon, 20 Jun 2022 07:44:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sb4GLEShO+XgyvAndJb7IHNEPH9Lp4IYmxZ9CNVamnmGQb5vhQWVIoxkdw1lrsPSAMtX9r X-Received: by 2002:a17:903:214c:b0:16a:13bd:8447 with SMTP id s12-20020a170903214c00b0016a13bd8447mr11498094ple.127.1655736277382; Mon, 20 Jun 2022 07:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736277; cv=none; d=google.com; s=arc-20160816; b=COhUcxCVilHf98d1Lnyyqkm/qUpa8s7nQz1mQN/v0Nw9Yt0/X3vFgudIJEq0YVTBRQ niHNHfOKEsP6RNe8sD0TidbmAnugnMls7dZ0NY2isHTkttsuc0lvPwIylZ4rpMajJOYq 48dwMbns+vdLIiRQJ0SumMryHhnlbqy6XgXjAcgGAUPLeTlhRz2O4dlCc8EqPiWWH2mN o4qrhvYNjXW94gsjK81L1yTqlEwdzAsl+0+vjK5RmS0sALNbh7RG6EUprOTNDcRbdGMC M3s+pIYsqjPrroBGzUfIou5aa4lkVIIlSltgZNsS6vGYIOcqAsdS7lcD5G5WRRiliEOZ +nzQ== 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=bhUFRGaa4qJTncT6xCgewkc5mgbT1kbjjI6kjuIlX3w=; b=kBHE/s0xX34FpDN3FWkWBMNDoz2OzX1VIcyNG+EZhcG1LtNaCfeJzvzeEncwUGeTgz jmhjhJeWQnBBA/inIjMUSiVMp2Lm+O9D0kQaahC1Cb8ANzbdhbYjDA2Phmspigfbzdg0 J9tJFw+rWWtIgw5A209WpRTrli+vDYmH29Tgb3/zwF47EqQRrI8UWp5+h2Z8HMwNc8P/ SlTVyRrI4sfqJnJ+XVQIrwQfAGKJ8N/wHJuhyeSoX6KFAyDbZzTLaGU0Oc/wUKaTWdJz DWiNwfmqY+UCVQBWBR+FOuqEJnGy+cTgq26Pp+CVRR+xpB1qYEZ5cCJlxyvlZNSsA3Aa 8riQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f7erjJ7y; 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 z13-20020a056a00240d00b00522990cab89si17265836pfh.133.2022.06.20.07.44.25; Mon, 20 Jun 2022 07:44:37 -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=f7erjJ7y; 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 S243926AbiFTNBa (ORCPT + 99 others); Mon, 20 Jun 2022 09:01:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244017AbiFTM7L (ORCPT ); Mon, 20 Jun 2022 08:59:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC5619C15; Mon, 20 Jun 2022 05:56:11 -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 852E1614DA; Mon, 20 Jun 2022 12:55:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A2E2C3411C; Mon, 20 Jun 2022 12:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655729757; bh=G9sVT9BCC2t1SfzLQZXZjkGeZ3YE+zHFK85LE1yWtJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7erjJ7yy4VvjSivh6EkI2e2uduepLfkVic9nzOFkdTIVueULvaIpSgPY+BlLe5n7 n6d0vqn0SHtXM0rXGfJDYS4QPkUhi1jpR1m8T04YrPlkeuj4RKISajPKtNsEsR4IBA 2wrkpM9CDOl1nlQbH2m6iYMqtFnhbKlsPFdOCnKI= 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 5.18 064/141] misc: atmel-ssc: Fix IRQ check in ssc_probe Date: Mon, 20 Jun 2022 14:50:02 +0200 Message-Id: <20220620124731.431779966@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124729.509745706@linuxfoundation.org> References: <20220620124729.509745706@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 d6cd5537126c..69f9b0336410 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -232,9 +232,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