From patchwork Tue Jul 11 15:08:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13308940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B38AEB64DD for ; Tue, 11 Jul 2023 15:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=VsKFGvvHAid1EEbdBL8cVjiZBUg9Lj77gwjZqBvkS4k=; b=DQWs+Z31ZlQB93 M2brQK3WbP1/2WmijjQ5dX6E2f+XppojjMw6oNaifegwOtYIRtzl5xO2Jus5X0TVe8kM2fad/s2nh Z53vrtYRSYsOW0p4vNUFPZ+3VNelnn/PJTiqmXgn7lTf6vBi1igXWHV3TZrYcBFQ/ua/kQTx7Rsco 6PkGhPvmrs0K6eW/gimhTb5qmEqmIsSCTh4imY3w8iACaHMde+yQYGxllz0i3+1End5OH3Zj3Svbn upiflzxAMZaKQm4cfTPAl6YRVbB6BsxDSfglq9ieEYDrMmKPdbmW3EZpvXNU6TTdKXeIhsebvF+Kb Kvu0WlSTAbUX2inFMTng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJEyh-00FDDi-2a; Tue, 11 Jul 2023 15:08:35 +0000 Received: from baptiste.telenet-ops.be ([2a02:1800:120:4::f00:13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJEye-00FDCa-22 for linux-arm-kernel@lists.infradead.org; Tue, 11 Jul 2023 15:08:34 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:2b42:575f:41f:104f]) by baptiste.telenet-ops.be with bizsmtp id Kr8E2A00Z4w94eT01r8FTj; Tue, 11 Jul 2023 17:08:23 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qJEyG-00199o-07; Tue, 11 Jul 2023 17:08:14 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qJEyM-00EwhP-PX; Tue, 11 Jul 2023 17:08:14 +0200 From: Geert Uytterhoeven To: Zhanhao Hu , Abel Vesa , Dan Carpenter , Peng Fan , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: NXP Linux Team , kernel test robot , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] clk: imx93: Propagate correct error in imx93_clocks_probe() Date: Tue, 11 Jul 2023 17:08:12 +0200 Message-Id: <20230711150812.3562221-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230711_080832_825387_8BD5DC16 X-CRM114-Status: GOOD ( 11.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org smatch reports: drivers/clk/imx/clk-imx93.c:294 imx93_clocks_probe() error: uninitialized symbol 'base'. Indeed, in case of an error, the wrong (yet uninitialized) variable is converted to an error code and returned. Fix this by propagating the error code in the correct variable. Fixes: e02ba11b45764705 ("clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/9c2acd81-3ad8-485d-819e-9e4201277831@kadam.mountain Reported-by: kernel test robot Closes: https://lore.kernel.org/all/202306161533.4YDmL22b-lkp@intel.com/ Signed-off-by: Geert Uytterhoeven Reviewed-by: Peng Fan --- drivers/clk/imx/clk-imx93.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c index b6c7c2725906c574..44f435103c65a8ee 100644 --- a/drivers/clk/imx/clk-imx93.c +++ b/drivers/clk/imx/clk-imx93.c @@ -291,7 +291,7 @@ static int imx93_clocks_probe(struct platform_device *pdev) anatop_base = devm_of_iomap(dev, np, 0, NULL); of_node_put(np); if (WARN_ON(IS_ERR(anatop_base))) { - ret = PTR_ERR(base); + ret = PTR_ERR(anatop_base); goto unregister_hws; }