Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37010330rwd; Tue, 11 Jul 2023 08:20:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlGA3sLaez990U6nWLZx0gOjTj+M3qZfouPVmptpbEpUIsQfXdgf5suK1L9er+ZV3JGhxSEY X-Received: by 2002:a05:6402:64e:b0:51e:fd3:ae5f with SMTP id u14-20020a056402064e00b0051e0fd3ae5fmr17018987edx.19.1689088856070; Tue, 11 Jul 2023 08:20:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689088856; cv=none; d=google.com; s=arc-20160816; b=O+e1/Yt+VUQWTe6UcM9WwBkN+scDgXXtxD5oVwvXwjcGOhYAESY2wn30EVIwpl/EW0 AkYak6hnaKOFxW2OciAL1FhWCa0as7XmMG2k6b/mLPrA7yQGCn/ky0yyL6s7aqsr1ELw Y/gKEsNQNTI6YVAmTjik99a2ttCMn1z8RSqKYNQCLM+/u/j1jJHkH0vNCz0nnnVom39a dTDW5nIg7IGTNDXVZ0e1HBh9o1WF/GdCF3aNzVvSyOAZaXpRFm9FDTXAYV5/Cqb8t6oA aKhSBSToMVpjJH1fFnmWtogdC+RM5rmlHNODuHzUQtiZ7wyWdNd+Dtl8vZM8mm7NVmpK YdJA== 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 :message-id:date:subject:cc:to:from; bh=ulPhc1mfbApZDuqySX6jGwSvMhSV+NKz0YhU+y5Kghs=; fh=aIh5dn+kCM3Zb85HQ/VWRufLDuoPDo2CnNHsCxEr3bA=; b=xtpYmzuY7sT598tXv8GNWbUjSn2Xqo6wv2J2XOz8IN3sX8pJPqsqo2aRhell3TY76l ZxatkAiiMN1yd3vD1dkiZAMrVfKL4Gc+giEmqJ6gIUN0KWsqs4xkByvXhXJ29Z7W0ODK quuwVMmssUFd8fB78+Xx8gK6euhsq2vk/HM8fDU3ImGkyicdsnIz6gN75kBeNWi8GEnt yyW95CdNSCWSpqScznd+OICL2zTlm70eZLU/6CzzyDVBQLb7N0490es/fowqhEc/r/NI 3FJgM4bDd1Satwjx83qJwztew0qW64VQTwJxZJyw51lux1ji4uTF/Xcocp0trrGs4tIH oDYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020aa7c50c000000b0051e57e864adsi2284571edq.189.2023.07.11.08.20.32; Tue, 11 Jul 2023 08:20:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230397AbjGKPI5 (ORCPT + 99 others); Tue, 11 Jul 2023 11:08:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbjGKPI1 (ORCPT ); Tue, 11 Jul 2023 11:08:27 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52100100 for ; Tue, 11 Jul 2023 08:08:25 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_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 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 --- 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; } -- 2.34.1