Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp568516pxb; Mon, 25 Oct 2021 13:58:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgYcDCd2hr6eLsgnxZPXOw44OqC/w7YAuJZQblU4/oPIarPT9jHuaWW2fVkh4tXeq9mWrG X-Received: by 2002:a63:82c7:: with SMTP id w190mr11350989pgd.210.1635195509646; Mon, 25 Oct 2021 13:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635195509; cv=none; d=google.com; s=arc-20160816; b=R1cOK1rWGDdQBEtYWcqEM6O+3CBQy8L19MHzDkAWQ53p6Va8XjRdwgV5f/iR3eyE1U TfCFGTpJhoSgkUiJhzGrUfH3WemAuhPIB1mPTxSYarBhgxciqU6Qb6XogiuJMZNpMTOE OdTdPAvKXffUCNQ8dGfgFLR0vklfZnT+w3mIibxh8d2g1r4K4EjbooMOBI/RR90730Gk zyDRb9QdeVczK5IeRKQKbE8HComeNe8Id8zpjRICr0E/iugZr1xCsoOmUUwYXIGUpPqQ BzyUUQ6C80v1upIl6S6kIqMbnIUuT4eMSz54uvm4Wmjn16/f5vIRvw/6x9DFnhJYUHdQ 2iRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=8Ij5t37B3xflW2Ldvu8H9j1mHCbtAAx0PUkwvnyf2PI=; b=HcnOeyYppEwShjbapp/1zFzz9qr3f++ta2M2bKtT7cXZM8wc/ZY/MiLNGaWLyP9yLU TpCEaL5xTlRgC9I3N7oh+FkL3G0dfd47h/yRADg4ToxeshIRBYidV+Ofchol4drw+dOv F2DeCsnIrkZXDVa/SkpBTQcKPvWWlkEvtglReRPUjbtSPeM5bYIidRJAfflRZ7orbKkG XnLmHhzIkz+29Rt0ibMV/1s1bZRGkoaJaPLO4vgV55aRnwmsg8NxpGBDlIm6EehZOdCq 8miDXOxtdUXjFoDhcnhTOYOhyptXvvcdw1CUqgo2iL6GwHYH1Vem+zVNnPj5JS9d1sog z3hA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lp9si38034647pjb.42.2021.10.25.13.58.17; Mon, 25 Oct 2021 13:58:29 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234726AbhJYU7W (ORCPT + 99 others); Mon, 25 Oct 2021 16:59:22 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:33583 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234604AbhJYU7R (ORCPT ); Mon, 25 Oct 2021 16:59:17 -0400 X-IronPort-AV: E=Sophos;i="5.87,181,1631545200"; d="scan'208";a="98385702" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 26 Oct 2021 05:56:54 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 2411B41003BF; Tue, 26 Oct 2021 05:56:50 +0900 (JST) From: Lad Prabhakar To: Krzysztof Kozlowski , Rob Herring , Vignesh Raghavendra , Miquel Raynal , Richard Weinberger , Mark Brown , Philipp Zabel , Geert Uytterhoeven , Wolfram Sang , Sergei Shtylyov Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v2 4/7] mtd: hyperbus: rpc-if: Check return value of rpcif_sw_init() Date: Mon, 25 Oct 2021 21:56:28 +0100 Message-Id: <20211025205631.21151-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211025205631.21151-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211025205631.21151-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rpcif_sw_init() can fail so make sure we check the return value of it and on error exit rpcif_hb_probe() callback with error code. Fixes: 5de15b610f78 ("mtd: hyperbus: add Renesas RPC-IF driver") Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven --- v1->v2: * Included RB tags --- drivers/mtd/hyperbus/rpc-if.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c index ecb050ba95cd..367b0d72bf62 100644 --- a/drivers/mtd/hyperbus/rpc-if.c +++ b/drivers/mtd/hyperbus/rpc-if.c @@ -124,7 +124,9 @@ static int rpcif_hb_probe(struct platform_device *pdev) if (!hyperbus) return -ENOMEM; - rpcif_sw_init(&hyperbus->rpc, pdev->dev.parent); + error = rpcif_sw_init(&hyperbus->rpc, pdev->dev.parent); + if (error) + return error; platform_set_drvdata(pdev, hyperbus); -- 2.17.1