Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp908805pxb; Wed, 6 Apr 2022 04:00:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRfimjkuGdokMXjC2OTsGT5yOWyuSW0GA6LQLBr0//r+BjeBPqs8Ga0HYp+6h9LNZftYuo X-Received: by 2002:a17:90a:a416:b0:1ca:b9f8:bcec with SMTP id y22-20020a17090aa41600b001cab9f8bcecmr9162577pjp.163.1649242830228; Wed, 06 Apr 2022 04:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649242830; cv=none; d=google.com; s=arc-20160816; b=Ewo3qU7bt0qiOMf7o0rBGyQvG6pR9hSsz/O78V43ku0SFY09pT/6y8ezjc/8beMAnl t41xT+sXR44iiE/w61vKsu/ix2lttHyEj+Qi+OhuPtLOuHxxKTlHWLzQYA7MX53Yyn3g yU6NWoDz/8QsOx7z13AcNoTQeUR49oq9ySopPJwiIgHIp06kv1A3ydWqrG5Stq+xogud VikO/JY06PQLOa85N6z+d9T8XxOqGTUvl8gTYVj1XBB+ohwyEC5VnZB7TfKY0Am4z/0F uPxcwcqzTALCG8u25+b5/E6kPDIl0ifH3aOBzvrCvKlhvHVYxyEi0ruGEqWzcmhnCssB GbaA== 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=LgeH16WeSqbpNGNmN+s3gywJOKmmVCC/WT/xqI4klI4=; b=Q10U6lDYFC73HzuaoJMgr+HuVMojpbLlUdafWO8Yg1Y3qPAdT2r12TO5GL6nuhqSPu /QffueKM56K1KO+qwhdpgwkzJ8/FshTA4Dd/vwtTl77NcD/+cB+bBQeN4aSEA1YjWy+1 hlVvFJUjdYoZYHXOJDopWL/Ehqvghr52heiFQdbjwrDYMlBdN8DFoLWE10UHoXUwVhDt GA7q5lFiTmmPKzHr7N0qsdQf5j0HZi6OwZFTs3HaIH72xIfsOabBYrm6lVJjRvpl39z8 Ata5Iyz/Mb8f6SD5kResBaCClS3M7qznEpKNuxNnxhW3McnKeyfdO3IorcMff9XrgFyR W0tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x1W97CUm; 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 s201-20020a632cd2000000b003863116c04csi14391978pgs.192.2022.04.06.04.00.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:00:30 -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=x1W97CUm; 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 92FE8450316; Wed, 6 Apr 2022 02:23:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236160AbiDEIBe (ORCPT + 99 others); Tue, 5 Apr 2022 04:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233116AbiDEHwI (ORCPT ); Tue, 5 Apr 2022 03:52:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99FE49AE44; Tue, 5 Apr 2022 00:48:28 -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 3668C616DE; Tue, 5 Apr 2022 07:48:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40EE4C340EE; Tue, 5 Apr 2022 07:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649144907; bh=ChCoChCJ+bm2s/23Tdv+MYjgZvCiKzNdR0c3alOGOmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x1W97CUmjlIwqpxbevdhvrAFOC/5gFzoFdffyjwjEtNy+KXsBMKfY+7wDngdpqLat TGWpHLFXi8FnfUor1vwUXZKsyUDbKucWG7bd0g2wqOXWNQcMBqFqtXMweZYDFdvFWQ MgB7mA6u8WAIeCG5vR8aoQYcNEb0c3XHuaJmlk5k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.17 0213/1126] spi: tegra114: Add missing IRQ check in tegra_spi_probe Date: Tue, 5 Apr 2022 09:16:00 +0200 Message-Id: <20220405070413.861469208@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-2.0 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=no 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 4f92724d4b92c024e721063f520d66e11ca4b54b ] This func misses checking for platform_get_irq()'s call and may passes the negative error codes to request_threaded_irq(), which takes unsigned IRQ #, causing it to fail with -EINVAL, overriding an original error code. Stop calling request_threaded_irq() with invalid IRQ #s. Fixes: f333a331adfa ("spi/tegra114: add spi driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220128165238.25615-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-tegra114.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index e9de1d958bbd..8f345247a8c3 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -1352,6 +1352,10 @@ static int tegra_spi_probe(struct platform_device *pdev) tspi->phys = r->start; spi_irq = platform_get_irq(pdev, 0); + if (spi_irq < 0) { + ret = spi_irq; + goto exit_free_master; + } tspi->irq = spi_irq; tspi->clk = devm_clk_get(&pdev->dev, "spi"); -- 2.34.1