Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1691588pxb; Wed, 9 Feb 2022 02:18:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRejj784kIgmJopiQ8CK22/ONiVKuaehlx/QNXo7A/DVBRJNuuKp0xxZSTYAUFhH6xBMPf X-Received: by 2002:a65:62d5:: with SMTP id m21mr1308615pgv.135.1644401936625; Wed, 09 Feb 2022 02:18:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644401936; cv=none; d=google.com; s=arc-20160816; b=cG7/JSIYV2WwP/Vd0OwnnSGc5I2bCU+HW1D/XIxP5+WcUU5aiaBrld5QAdS1XYh6Ey xLbgwkldW6EF1tYbn4r+cKRtT9Qed6GY+w40JsQnD9Rv3UCKKSWegv2Eq+UTcdR299ok Fu5VT6pURhUvlWrJuyY64QANLEq3m4Kt2PT8Qj0GT2iAsOGMaal2iR+5R1r+XfVe9IhT aKHBTURkcWdzTpdXYuEGAzNMf4K43dZY9l+OWpBogslj7q2oCWEK6npxgd0amq2Dk8jv QisTFE9d1GaQQqKY3OGgs/OF+uxGcAimr+8ZwNki0tTOxbor/O9ZhQvZyNX71L5ko1Ti slOQ== 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=9UJnU1Bo9DwnFVic0IZZ71LIwQb4fmQCG8k5MQ6N8Xo=; b=Bw9iXLhYQPChkplSfW6/ftXRDGJxI/STurw15o4KmnYCLUINMfY+GD1eCzSFZ6uD+L ff5brnOiaQ8zw72l3o99odUZztC6ZhNBQsbz+Oo5c1CZ5gwrAtnzkR4eM2lYyTmQANiF hNt6cXPMgfI21MGBy1ziz6jUnWIy+FERHhz+2hok3bFDKOiHTbUSzzdf77UFNXHE7c8v saaIejIGT/9NWLa6jCJ3B5HngGqx8N722HWmPAuxiHCZbK6Yf+N2cJ6kdf6IzrCs9SQC HFmAB8G7tyYsYfanOOtTpmd31bMXyIn3Ydd9Ef3UUl0VvfonGpqmb9Uoy81/TvhcRvTu PZSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S00cdXgw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id a20si2103903pjh.162.2022.02.09.02.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:18:56 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S00cdXgw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 06E08E032A89; Wed, 9 Feb 2022 01:17:51 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383273AbiBGLV6 (ORCPT + 99 others); Mon, 7 Feb 2022 06:21:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381510AbiBGLRL (ORCPT ); Mon, 7 Feb 2022 06:17:11 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C02BC0401D2; Mon, 7 Feb 2022 03:17:00 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A93646126D; Mon, 7 Feb 2022 11:16:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88DC0C004E1; Mon, 7 Feb 2022 11:16:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644232619; bh=Fi5FmP3vg78vf+vuAoyI4qaqL8RRmG0PE5bYYQm08KI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S00cdXgwBxdWsR5BlfZZWdr7J6cw7vDekJtSzOIJmGqeXzpHS4t9rLevPrvlJCm6h O2ANp3GZje6wGsEnuaYE9U7TzxaSU7q2gSbbAkM8ZFRJJIcGmRzEEVjDtfo+2eeUQI jkb2KcKQiQ1j4JlxzkzQrihY/W8Q/aTQ5Fnhzh1w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown Subject: [PATCH 4.19 69/86] spi: meson-spicc: add IRQ check in meson_spicc_probe Date: Mon, 7 Feb 2022 12:06:32 +0100 Message-Id: <20220207103759.932004839@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103757.550973048@linuxfoundation.org> References: <20220207103757.550973048@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 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 @@ -529,6 +529,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) {