Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4930657pxb; Tue, 28 Sep 2021 07:10:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9SQRzqFKP4SlQNq0fzVOKT4z5KA9HRMiBJblF0aUnju/szFrGRl6ya/QkLeE4Z5J2+2xt X-Received: by 2002:a17:906:ed1:: with SMTP id u17mr7125332eji.304.1632838226994; Tue, 28 Sep 2021 07:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632838226; cv=none; d=google.com; s=arc-20160816; b=mbJ+akGYPoIxo5JKof0x0taRqVljSc+/9eLNPXYp+i21Ku4uennbC6wMCpmfqZKggS Dcgezx6K71Fvn3Cy8/9gVSTw4I6B1KJNACiwbOiISDyPA+uV1/rasH5/jJfWTZ2qJ+87 9IXbhy7leJUk640vGyTueA/SkkW7Yh2r/ENPaHJtEwoupzdGWa1jfD3tqOZDVbk8o4CQ wLa9GKog1jncbSa7wRWByFJovVqaJ0/caS32KX+QohMUAxu2Ga8RRa7rP9K5YRGQJ0Pa im7US21ZDrUt40HtHfcsp4wLaUpBGt6aiPvWXdSih0bBGsWq//zozFY6wzQH5bwFhKnE 7lTQ== 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=HOqAR+lhwLhybXKmgoea7V99rW2rf7OW2je8Nw8JBBo=; b=aajmhks+2Ax5Vi8xlVy0qUdDTH0iZk4iffD6ssdaaoMrb3wrVuEoC8hDFGroEMa+Ip yjmxq9x4u/mOmSMlK0nMC0un7zBTwtS6hnlJPl16PGKzy3goDt9aMVJb7LDcUjcbr+o3 IraJDzdzIqtOxw9wNzeKyDcQZMyHvVEBnYzhz5qRvlJ5Sr7rxHZg1TkQdIoluqb6fVNG ku76W4ALgm+qMBpsjAe6jTPfK4XIAbIDsXzp84ya83zVOpcK0SQrJ+kvxPx35KdoQ4fN ZVcsHCg5ZayrGuBkxygZ+KDIs7dU1xh5kR+Krz+FP2lmZvywMpiQMexa6Uyzib1RCiiQ MsUQ== 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 o2si18585850ejy.80.2021.09.28.07.10.01; Tue, 28 Sep 2021 07:10:26 -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 S241191AbhI1OJf (ORCPT + 99 others); Tue, 28 Sep 2021 10:09:35 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:51105 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S241173AbhI1OJ2 (ORCPT ); Tue, 28 Sep 2021 10:09:28 -0400 X-IronPort-AV: E=Sophos;i="5.85,329,1624287600"; d="scan'208";a="95295291" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 28 Sep 2021 23:07:47 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 59B9F4007535; Tue, 28 Sep 2021 23:07:44 +0900 (JST) From: Lad Prabhakar To: Krzysztof Kozlowski , Rob Herring , Geert Uytterhoeven , Vignesh Raghavendra , Miquel Raynal , Richard Weinberger , Mark Brown , Philipp Zabel , Sergei Shtylyov , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH 4/6] mtd: hyperbus: rpc-if: Check return value of rpcif_sw_init() Date: Tue, 28 Sep 2021 15:07:19 +0100 Message-Id: <20210928140721.8805-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210928140721.8805-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20210928140721.8805-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 --- 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