Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6143947iog; Thu, 23 Jun 2022 12:15:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vL7SonZESb8/ykqKOKrU1WXIUCTQk3yVYITxSEwrsXoIDG7xBt8lg6UFfJmhJvAs7tSN7M X-Received: by 2002:a05:6402:2933:b0:435:80dd:f75c with SMTP id ee51-20020a056402293300b0043580ddf75cmr12506148edb.302.1656011725281; Thu, 23 Jun 2022 12:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011725; cv=none; d=google.com; s=arc-20160816; b=ioxh3JMn/xknv17MdyncYU6q9O8YdGY5SorulD/GTEv30RCgSSlICNNFYLUSsi0l// 3j5GmP1cK9K24fmxQSQa34l9pxrUFrfIRTmSLd1CyJZbx8Ip6pgCpJYMYrP2mEyohVF0 hbaOriKxkoPlJwr+Ehasc0qolGpqkbBBF3y1ktTZTNhKGIe1DZOVB1oqUlM0qCkkG8kI kdwFo4kjaR+HDmNubu0Eh2JClqqbP0GPA4vPfN/ycvSG5rIAKyv5wcaERAG076alfhxG 1Bj/zX13YePy76FlO2M4I56inHjMDwXoQHbeBdaPQJov9JNahyRuXD3PYNZJxiqPBq86 LEIQ== 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=9YiNCZW9FUm0J76f8uA1hFgx1He3ZbNyGgwNwhY4L7I=; b=HAPr0fuZn0qDOxWUXOMh4w5KIlOf/Zr5CGIFHO41XAmYQGzWYugouOPLS1bOrvH3oj WO1cM57Riw9vm1f8o+TgTOBySWQuYsZwT7ytcAT0va0sBZYnAZg4554fXeFmhRzLsDKm v+oh4DF6Bu8ILuRp+uO4pmqEPzNTZmcuvyNy4xBNdaMnteVZKpQt/nqlpPWKsVdQUqjm bb5ex6T05KYzxliYuHj9ngpdgtaUsm1ViNaxOlqrNq/i/7sx6wxrEXKkh6Yfmt9fKzgS cFZfi7cvRAUOzbAMF9F0g4X1KGMnLu+dC3OP0tF+TUdhDwN7G8JASBY0Sxg+ry9UWucU /jnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E6TR0jTt; 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 cs21-20020a170906dc9500b007232e05af5esi2005225ejc.287.2022.06.23.12.15.00; Thu, 23 Jun 2022 12:15:25 -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=E6TR0jTt; 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 S229485AbiFWROT (ORCPT + 99 others); Thu, 23 Jun 2022 13:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232416AbiFWRLp (ORCPT ); Thu, 23 Jun 2022 13:11:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E91464E9; Thu, 23 Jun 2022 09:57:41 -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 A4F3A60AE7; Thu, 23 Jun 2022 16:57:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78774C3411B; Thu, 23 Jun 2022 16:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003439; bh=JDkFbqkixMSSDD5OvBYLoneom5Z3SXLrXaMSQ+GEojA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E6TR0jTtyeSAovXtQLD8lGKjIDRVZ2Alu8QRq7mcBHL1xM718gU9ISxdFJvkvQtLi YKqhbKp23GQaTYfMnWa0KT43xsZv2M0go0ogmwGiHYkF15GNUbW/gKDzCLcqOVpXlC Hqx6fXUqp9kNouY4gMf6BsTrlyK9L1Mq3Rk5PSi4= 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.9 239/264] misc: atmel-ssc: Fix IRQ check in ssc_probe Date: Thu, 23 Jun 2022 18:43:52 +0200 Message-Id: <20220623164350.838636098@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@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 8c9a444d61d3..65bc573d6ab4 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -190,9 +190,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