Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1675358pxb; Wed, 9 Feb 2022 01:53:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCrVSqBlRA2AGdNFcmxlOS27mK8N3W1OyI6vl1HLDF9lG8P7mEtEu87BB3eoXTDSDrq7fq X-Received: by 2002:a63:27c4:: with SMTP id n187mr1268889pgn.504.1644400437902; Wed, 09 Feb 2022 01:53:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644400437; cv=none; d=google.com; s=arc-20160816; b=zI+adcxPEjVwq/VmQFTlU95fG7iW+EbbKH47aJDizOnly/1SwnTubJR9yQRFabzM2E yQL9LK1+TTUgdRfNXSZ8jRS600GA+VMQvrtr7N8G2TNSPrubjVkI7xZrzQLZGE9TjogQ JAheKABl+jfWZI6tpJ36n3D3GPE24jL0z463GQTZ2Ix5jhhRb81kJiuimmjDFx9PHy3c LsFvE84YNwPX8Cd7yxsnI2rUOnshDcclcQ6u/7g3Hl+wb94s0I01c45h/xc+pD1gsXuM 4Ku9F+dSMQWP2TeEaNytr/xXrCnY2j9B/ARZDJrL+59UJLr2oNFtaP5aVxuryhJHb1uu lcPg== 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=DCMjLljrMTOSio+lH/lUZsMM913allXRg1XAGOg3hPY=; b=b3cSISEOboiKzxSfny2TuixN7LoT6rZztW61FFaM1BGkeOdyh5yIzz4p5BNFN2fflW t1/LsXLs0l8fPtK0kAUIrnYBENtVGeqiHwLMVrBFhvUIoCUPsD4LD3bYzRJF9fG8iP4h VqiYQHHpC7xRUsS6fiN91128bIS0LTHwlFZnOEV3kTRrQN5PREvonsl7t71lcmjuWRVs cmSXT1qjDTo5kdXFigP8Ui9Uq7Jo76DbHCtrrwLYOYZOHT16Hve2QPHU6HAfKFxBWalO WbowL3iEn3PeFeniY+G99GWLlCSeQ6AcgKtt+Md++bjXsRCzZGy6FD9hHIL9sdqDzJye Vj/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JB1XPFpT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 6si15768264pga.277.2022.02.09.01.53.45; Wed, 09 Feb 2022 01:53:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JB1XPFpT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389649AbiBGLuc (ORCPT + 99 others); Mon, 7 Feb 2022 06:50:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383529AbiBGLaS (ORCPT ); Mon, 7 Feb 2022 06:30:18 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BABF7C03E96E; Mon, 7 Feb 2022 03:28:37 -0800 (PST) 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 60744B811A6; Mon, 7 Feb 2022 11:28:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C137C004E1; Mon, 7 Feb 2022 11:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233315; bh=ndaHqpqn4sqHYZzskELwPY5K5zp5TlQe607bssm09fg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JB1XPFpTL81HohY5Wwi4v6nugZ+1++8qmVyo5PBDxGUyxuEPpeQ76SCUasJcylqgM LmCbku1EAumh0IvLxeOvaHkxlATo8GZsS8qo/IxI+xUhAE7ZXXACH50qWTbLyRx2pf 3ORHsLTBUOnG06Rrgl3rvTIklx07A5EXbJFPuooM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown Subject: [PATCH 5.15 052/110] spi: meson-spicc: add IRQ check in meson_spicc_probe Date: Mon, 7 Feb 2022 12:06:25 +0100 Message-Id: <20220207103804.039776054@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103802.280120990@linuxfoundation.org> References: <20220207103802.280120990@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.1 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 commit e937440f7fc444a3e3f1fb75ea65292d6f433a44 upstream. This check misses checking for platform_get_irq()'s call and may passes the negative error codes to devm_request_irq(), which takes unsigned IRQ #, causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_irq() with invalid IRQ #s. Fixes: 454fa271bc4e ("spi: Add Meson SPICC driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220126110447.24549-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-meson-spicc.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/spi/spi-meson-spicc.c +++ b/drivers/spi/spi-meson-spicc.c @@ -693,6 +693,11 @@ static int meson_spicc_probe(struct plat writel_relaxed(0, spicc->base + SPICC_INTREG); irq = platform_get_irq(pdev, 0); + if (irq < 0) { + ret = irq; + goto out_master; + } + ret = devm_request_irq(&pdev->dev, irq, meson_spicc_irq, 0, NULL, spicc); if (ret) {