Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4932622pxb; Tue, 28 Sep 2021 07:12:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvWfBHWMFij3Hwu8KhYyjWJaOS3GypBUB1790dSae3HYBzkwfV5Kev4OqpWT21uS+jT9np X-Received: by 2002:a05:6512:3b85:: with SMTP id g5mr5901647lfv.480.1632838346016; Tue, 28 Sep 2021 07:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632838345; cv=none; d=google.com; s=arc-20160816; b=TvJrDTe/uvPT0Wzhg8ofLUEoLSZnhFzBKVdCoIauRfk3h2xuvp6R4geBd1T9xGtjlu THn1qzTvy0828k0YVg22Ujo8rktEPn6ZE5Fg5VHbGbxHPft09SM/fa3H6S8f2mscdX6E QybC5+v5n1wJnF5S3lpQwkoolyKxTh38IIt9sSbyoxZZ3pxDef+Tp5w9R56/XpQHLRc9 YO156L39TXj3WYTUHxEC01rJZWuG/EyTF9wbEqmWHu0kAkjya2FBQ4iLr2o0pVXJvq5x 106vIQaDMJzDAMd966zyxGK2BI7EHjPOY+38AJ+wxLoWl7IsfQElLu4YBwhFAakS4de+ +YrQ== 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=TGv1ORvqjlM3pKD8bptXmcKFr3853l/l+ysPnMih4AI=; b=OHf/uVkF5aM6Q2pgymVJC8a6OVBYr+xRpCW9a2sPQJSsCTKWCcDBqEniH1kj1rhUsS Q7imWCY8kohxGSGnRbwzpZQPrbNxDjXwjPfuSUODxFMsYPZs+iJ2uvXA9Y7llxi9cq+2 XjlPqboy5Tb7D2Wpv8UJxkJFvZ6Cag+oAxx4/cVifUE5pv8n4yEoMUlHfNzYezGfo2vA HSlx8jEjimODAutbCTQbXSeWaG5rAAlFPMj13ZTJNqkzM2/qIUwZFrs5NkfmcUGLE0SD bAnT2B8O7YB25TGCSKJDo0TwzLV9GOtpvQjEmEQaEg0mFYhgVMsfluIoXEPDQkPPGFSy T+jA== 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 jy1si22998137ejc.140.2021.09.28.07.12.00; Tue, 28 Sep 2021 07:12:25 -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 S241161AbhI1OJY (ORCPT + 99 others); Tue, 28 Sep 2021 10:09:24 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:30263 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S241081AbhI1OJY (ORCPT ); Tue, 28 Sep 2021 10:09:24 -0400 X-IronPort-AV: E=Sophos;i="5.85,329,1624287600"; d="scan'208";a="95435612" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 28 Sep 2021 23:07:43 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 6E74040061B4; Tue, 28 Sep 2021 23:07:40 +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 3/6] spi: spi-rpc-if: Check return value of rpcif_sw_init() Date: Tue, 28 Sep 2021 15:07:18 +0100 Message-Id: <20210928140721.8805-4-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_spi_probe() callback with error code. Fixes: eb8d6d464a27 ("spi: add Renesas RPC-IF driver") Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das --- drivers/spi/spi-rpc-if.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c index c53138ce0030..83796a4ead34 100644 --- a/drivers/spi/spi-rpc-if.c +++ b/drivers/spi/spi-rpc-if.c @@ -139,7 +139,9 @@ static int rpcif_spi_probe(struct platform_device *pdev) return -ENOMEM; rpc = spi_controller_get_devdata(ctlr); - rpcif_sw_init(rpc, parent); + error = rpcif_sw_init(rpc, parent); + if (error) + return error; platform_set_drvdata(pdev, ctlr); -- 2.17.1