Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp964394pxb; Wed, 6 Apr 2022 05:29:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6QIHstHDb6W0Ccj1w63p3Wpw/Wh7veDEFQNgQbBgWHwXl1WmY1n10AGue9LX2UHPlPTPv X-Received: by 2002:aa7:8893:0:b0:4fb:10e1:8976 with SMTP id z19-20020aa78893000000b004fb10e18976mr8631915pfe.36.1649248144573; Wed, 06 Apr 2022 05:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649248144; cv=none; d=google.com; s=arc-20160816; b=nWDzlGzyHVUFfasvaiVRduHFYy7m2kHJnGu5FAu9+C16Wrcx6NhuM7VBauFbAklKI+ 3qxWQrVLpGPqAmKKoaf1kAhFTj1aTL1CKiTZnNxf9T7oChwgSbYRE/K5/nJ47CXPUzq4 KAVX4kIc4P9eIZ9prG751tlW4q2fPCbFCTOpI2iPoGcmGvok8FyiMV/qqurPN5Cgnjvl 5XAuAYB1eX1SutI+0xsoewo0+3NtEs8KmwyFkz5dg7EfWliJp1Ujc9jTFwwwRYGhkWoR y4jpT1TlwtFd0vsqy/zRz4wpH1V5s3RvqMfwHC6+dJWoETiAiR5EYYuYiAUgUnczK5ED gcaw== 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=MqVodXWspr2Y0t8i+4z5pkTY0G1/E3JE609A1xa5bXE=; b=OQ3v57ggG6woezj6NIX1TLGIcHEQDHz+ytnT04I1GVYHLuJDGXxLsYKL2WL5neF2wl MFzkgRyO/3X9faqG3+yfIVObXHA3V1pXqDlXyEyuc2Dxe/vL+UBfGrJk6ufh97JIQ1Tn TPPMJ8hpTPCYKHrke/VVESZinaQQ/jAZb90bXdd4qp2JZEep5O/RyqPWsTsUrsPljeNj cggPaphpI3KVJQIHUFHSlcXgFAlqpxcFze1dsFrj0sBZYgx4xGAhsGeCi6SQNSdIFwQQ R59VUc3HEgZVg/glOOVsDksWRL85IDwCmm13TZ25Qr7kh9W9eAO1TIyRItobImAD+rX6 0M4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pCBJjGAQ; 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 bm1-20020a656e81000000b003995724dcf2si6287738pgb.52.2022.04.06.05.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:29:04 -0700 (PDT) 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=pCBJjGAQ; 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 08554561212; Wed, 6 Apr 2022 04:40:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1458175AbiDFBMY (ORCPT + 99 others); Tue, 5 Apr 2022 21:12:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348820AbiDEJsj (ORCPT ); Tue, 5 Apr 2022 05:48:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CAA3AFAC8; Tue, 5 Apr 2022 02:36:18 -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 EC71561680; Tue, 5 Apr 2022 09:36:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0CF8C385A2; Tue, 5 Apr 2022 09:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151377; bh=xZFlO/Ssj0ilwMz4LbbFsHCf7q/ubFY/jXMHM64j43U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pCBJjGAQuM+YAd+I5Vh8jCSDeV3J91J2lxmUYLjc8i2UW0DcI8YugfdHPRjt/BzG/ tKm74q69LCXn/qDlTiYjDU8CZTYifBMuCGYqpk/yU1MtMuxFxKPR3QuVhWdx77Tmni 0IoM1TWQR7TItR1Y84XtW1NRgoQqZbKegjgeT5rw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Miquel Raynal , Sasha Levin Subject: [PATCH 5.15 393/913] mtd: onenand: Check for error irq Date: Tue, 5 Apr 2022 09:24:15 +0200 Message-Id: <20220405070351.628038201@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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: Jiasheng Jiang [ Upstream commit 3e68f331c8c759c0daa31cc92c3449b23119a215 ] For the possible failure of the platform_get_irq(), the returned irq could be error number and will finally cause the failure of the request_irq(). Consider that platform_get_irq() can now in certain cases return -EPROBE_DEFER, and the consequences of letting request_irq() effectively convert that into -EINVAL, even at probe time rather than later on. So it might be better to check just now. Fixes: 2c22120fbd01 ("MTD: OneNAND: interrupt based wait support") Signed-off-by: Jiasheng Jiang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220104162658.1988142-1-jiasheng@iscas.ac.cn Signed-off-by: Sasha Levin --- drivers/mtd/nand/onenand/generic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/onenand/generic.c b/drivers/mtd/nand/onenand/generic.c index 8b6f4da5d720..a4b8b65fe15f 100644 --- a/drivers/mtd/nand/onenand/generic.c +++ b/drivers/mtd/nand/onenand/generic.c @@ -53,7 +53,12 @@ static int generic_onenand_probe(struct platform_device *pdev) } info->onenand.mmcontrol = pdata ? pdata->mmcontrol : NULL; - info->onenand.irq = platform_get_irq(pdev, 0); + + err = platform_get_irq(pdev, 0); + if (err < 0) + goto out_iounmap; + + info->onenand.irq = err; info->mtd.dev.parent = &pdev->dev; info->mtd.priv = &info->onenand; -- 2.34.1