From patchwork Sun Dec 24 16:36:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504340 Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71608747F; Sun, 24 Dec 2023 16:37:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="d2btJZgB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703435819; x=1704040619; i=markus.elfring@web.de; bh=HUtTyqgAjeXilij1EZvW9BI8jaGz1KwDa0ackvdaMP0=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=d2btJZgBjrL9shctEps3kZP6ar2tniPSbSRCDxu5GQKJuq9gCNGhMqPt2GrvewjQ 3IDdl8d6sMRsR6RugTGpDyuJ8Ny54xfbFq/osyKsFMDoqUGOqMivCT5iVw/Z8zHCR FCBCHvRnPw6aZ8gdXOOdq/roceRzdW8gN0OxeLcSmzHjeVHdzJjWpkmJTlcvrkJM1 MpXaBo0FyGv+8i8VfajSsWx2eCa3MqO94+K6TqEQTinPg0c5MvzpFCSjZwzwGuiIN inQVAyjI0MEE+/MMujKR5HtPxyygugniPGRUwm672dw+rBdOc8rF7ZR+FrPj1pkmA 1wzR9sjG78uxX4Lm9A== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M6HKG-1rJcGY3hhQ-0070lV; Sun, 24 Dec 2023 17:36:58 +0100 Message-ID: <422c6249-31ac-410e-911d-ec25aeee126a@web.de> Date: Sun, 24 Dec 2023 17:36:57 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 01/10] clk: ti: Less function calls in of_omap2_apll_setup() after error detection Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:5Zlu4vBjOn8y3rhK/v7xJFB3kzVjuBnaLVTVepoXE3uf2IfFtqB 6rHVkvjJnEO9/UjDh4AgBecn1KYpjrdkyYpVByNrgF+lPLy6EhBHUwttNktZ3HbbeWAY2WZ ynEcS9grOUky6y9Lp7PKZHfuvoi7y2yUIAbBhDW+E2l1Vsw6ZCmN0SawMeLTX7aaB1iirtb IJSPvsHD6I4Ry1wVjcZig== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:iocNUSrfeNw=;wYkjPLwi2LIAvzmFQCTm/TVNKNP dySDCNs/XyI8mriI9wR/iF0jYz36JlM7n4uOAlurxXlRCek9gBOiFIB4DPPXou0jXevH3ao4E Xf1u50XGvq8y7rjPJkSoJ6d+LELHTsmWYthxYMkHtBxRq/ANC3OCHy0uAI+RuuTCGORLDGLxo dZ3pJYhcbIMIGaU0w8sikQ/Fh10GhCu3FHR5XDP1O6zRs+K3O3zFk8z/YwEdMIowxBIWioBco DY6oUDExpJtAhyExNYuia88lcq3I+uUU2pVj2AM9iygDwQ2ZsdmgowuktDtsGzG0b/ZLADVUR QZWswuvVh7GXTGiukDJz3hIoW92R1dLQQc0fBB9r8VpzKustixfEIblNY/+oznttG0dHfvCRU ETRz2J3h0/pM/4RIZdfBRwwWnUCMZkGZcSeOpjVDYV5Dv/DT+cZ9gDNX5WPE3LyEXoVxP6ebp fVw8OKY74NAL5VJkUsUMpolCNOxhe/lJsHVtipS2CZV8A9nRMnTtzhsg5/IYdq5/X+W/H0uX1 CTEHoQGXbZn/QqUAtAcm2W53Kb2YBHP7pkaXEGiPzc7ibeEjEk55QYU0FUaF9Kxoy/05HGwVh R49G5+LYIIhoO2+YGY4pRkXqYBSHCgV+VWGu7Ht4yXCgEIYI+H/exhGOjbBzyJk6q8dwVgi+x 2CCEzxT0B+O1v0p+sCFqiV9+fEthbUCTUIVYUtokvxro/4N9Mcox1ArD0a1KEyBbrIt+HsB3D VKEhkDIMAHKCKSaa8Am/FZOL4kGUJ/lQTbrYrWqfi8MlrlOS1NW9XaxdmRHtuEWnXyaPAgrxQ //78P2kKxNwxGGT0YMqZtAh73NUtZHsHqpMvgqcRwav8/gHR2SpVtLojRZ26IslwieeL69c+f e1d8+55MqT1lMAqYo60S1ZZrJAIXHM01vDHTXOoyPnDUQpiJvuq6eJvU1jei1BFT+a/ShrKuM jrI4PA== From: Markus Elfring Date: Sun, 24 Dec 2023 11:15:27 +0100 The kfree() function was called in up to three cases by the of_omap2_apll_setup() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. * Split a condition check. * Adjust jump targets. * Delete three initialisations which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/clk/ti/apll.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) -- 2.43.0 diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c index 93183287c58d..929c021f0cdb 100644 --- a/drivers/clk/ti/apll.c +++ b/drivers/clk/ti/apll.c @@ -338,21 +338,25 @@ static const struct clk_hw_omap_ops omap2_apll_hwops = { static void __init of_omap2_apll_setup(struct device_node *node) { - struct dpll_data *ad = NULL; - struct clk_hw_omap *clk_hw = NULL; - struct clk_init_data *init = NULL; + struct dpll_data *ad; + struct clk_hw_omap *clk_hw; + struct clk_init_data *init = kzalloc(sizeof(*init), GFP_KERNEL); const char *name; struct clk *clk; const char *parent_name; u32 val; int ret; - ad = kzalloc(sizeof(*ad), GFP_KERNEL); + if (!init) + return; + clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); - init = kzalloc(sizeof(*init), GFP_KERNEL); + if (!clk_hw) + goto free_init; - if (!ad || !clk_hw || !init) - goto cleanup; + ad = kzalloc(sizeof(*ad), GFP_KERNEL); + if (!ad) + goto free_clk_hw; clk_hw->dpll_data = ad; clk_hw->hw.init = init; @@ -403,12 +407,13 @@ static void __init of_omap2_apll_setup(struct device_node *node) clk = of_ti_clk_register_omap_hw(node, &clk_hw->hw, name); if (!IS_ERR(clk)) { of_clk_add_provider(node, of_clk_src_simple_get, clk); - kfree(init); - return; + goto free_init; } cleanup: kfree(ad); +free_clk_hw: kfree(clk_hw); +free_init: kfree(init); } CLK_OF_DECLARE(omap2_apll_clock, "ti,omap2-apll-clock", From patchwork Sun Dec 24 16:38:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504343 Received: from mout.web.de (mout.web.de [212.227.15.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BCD1D27A; Sun, 24 Dec 2023 16:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="M1W+/3hU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703435921; x=1704040721; i=markus.elfring@web.de; bh=CAB4VQvQ8vvQgycqUYcZEZDvRj1YXXBaD0h2ZtqUKNk=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=M1W+/3hU0SXqPb0RjBVtvbE+VZL1bLI4eHMUM8OglLo7SrFbIPZzStzubCBn0/8j TvZ2oD8WHtwqnbMyhDL6w9hVD1ZCUNeBqGn8baenssLx5nVa5xykeCUyzAC8b8A23 87S78NeOLg0W8eNAer/4d2gx9c7kMnedGAwZ/LEBmXrQPJ1y0L6ogAmfMYEI9tcZv m3wjVlNU3yK3Lka9WaD/NSIYtid2sR2xsev74/7rvx+maBtk8BwA/TprgpeDJjhvf pBKuVQ79V7swSyThB+TfgI40EDhCN7MN8Al90K4c5jNToh4iwOwvLfcDcFEHSxb0l KwgD30iO6Ig8ws2vGQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N4N98-1rAODG3JJO-011YvB; Sun, 24 Dec 2023 17:38:40 +0100 Message-ID: <6f3b159f-a3cc-4072-aae8-9792c9d274cd@web.de> Date: Sun, 24 Dec 2023 17:38:39 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 02/10] clk: ti: Less function calls in of_dra7_apll_setup() after error detection Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:0iUr9rY3KOdtRUuHpaTnIE9UM3Ofnc+IVxrPkfGbkvwxqOwawbz 7QZbl4YM2pyuLyOwskzMe0smfHmXUXiO1mrMToTpXvdOPL1Zexz3liAbnWZ9XgTBe0/ghkw GhWbDDprQR3vy9WUrd0pVptMrpZTaFNFx4s7yzGMFHg0Wc+4jWnwVlwcmL1kbH5a9TLvtGJ UMvosAlxJlr3lByLehkzQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:wNYY4Bv+5RY=;k4r5glqF+IDQmcblxV+FmhkJKeC akNtHh7j9RuPCJ5AJRHcRrx3X4xmH+j7MKnqiN75sZCvJ1vxYrHgvgmeM3GVZLS2LgcWou4NT sn8kQ9hEoseFSLsELpIPloXGyQKPov3sGs8TO4njzi88kO31F8dF2QB2ydayDoBfl90LsNd45 rIXCtQ3bgAnY64XQKRUvm3gBrr6FAZVzdJYhlSgdIXlcCw1ILRhLCRPonOdIWnHqaqeT1jtqw dRCjHDn5EfS2nrTlpGooS5taw8uclJkjLjIuApTFfenktBqTLwPjH2hrvCRUx9VL4qGskFJ46 fyeYtOSM3xeMespOU8ggufJZ9WpltmfUGq95mXLCy/SXAY7YdfNgFVqEY1n/Y/nZkx9LetJj4 r5eIvDf+hjdHFYC8OWzShsa1yRllAYYJi2hkQBPDjyLV0wnV6EPS91noF9SbAvpvZUq4HENvI N6vgMVrFddPViKeS23l0ekktFFcdJRkC+hzR9KnD/cGyf6gUHjSQFIZO0rwxtjY4ukzp8PgVP PZIychVq9YU1O3/9omGBVT21wL6EtDyPPKIfQvryw1K+j0RiMG3dDVnWRoRyhSVXHg+sKfaCH TIWrGS+6o83gXD+e8B/pQfjjDQl3sQy1jJUGqj5Zf4WfLoV6vZIEGEd8hBf5gyY3HcQkDMYHD ELWJCthfCZi4knZVf0vWO4fT/mpCUF+N+QzOstY2klU7cF5cwgqESet52Cs1X7KMYX8GIZZEI 9S3CfFknzZe4SqtE1Mlf+7htqS/0OyoOuPYv8KBrmFsWQH2KdXVF2GIwDQ0n3gg4dz0kUvZMz d8LW3mUsrzyYs1bythnlYZrnFU3Z/n0cJwlArRezZ3yDTo29bTFmZ6PGpUQEw3UBU4hvwHxf1 NZ0HOBspcHL0nl+S7RMRybsRIXCyw8BCUU097mRDAK4U6Tz0wDeiZ7fCUpTi5QEDHtcE4DkF+ MD4p9g== From: Markus Elfring Date: Sun, 24 Dec 2023 12:27:09 +0100 The kfree() function was called in up to four cases by the of_dra7_apll_setup() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. * Split a condition check. * Adjust jump targets. * Delete four initialisations which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/clk/ti/apll.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) -- 2.43.0 diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c index 929c021f0cdb..d2be672521a3 100644 --- a/drivers/clk/ti/apll.c +++ b/drivers/clk/ti/apll.c @@ -177,17 +177,22 @@ static void __init omap_clk_register_apll(void *user, static void __init of_dra7_apll_setup(struct device_node *node) { - struct dpll_data *ad = NULL; - struct clk_hw_omap *clk_hw = NULL; - struct clk_init_data *init = NULL; - const char **parent_names = NULL; + struct dpll_data *ad; + struct clk_hw_omap *clk_hw; + struct clk_init_data *init = kzalloc(sizeof(*init), GFP_KERNEL); + const char **parent_names; int ret; - ad = kzalloc(sizeof(*ad), GFP_KERNEL); + if (!init) + return; + clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); - init = kzalloc(sizeof(*init), GFP_KERNEL); - if (!ad || !clk_hw || !init) - goto cleanup; + if (!clk_hw) + goto free_init; + + ad = kzalloc(sizeof(*ad), GFP_KERNEL); + if (!ad) + goto free_clk_hw; clk_hw->dpll_data = ad; clk_hw->hw.init = init; @@ -198,12 +203,12 @@ static void __init of_dra7_apll_setup(struct device_node *node) init->num_parents = of_clk_get_parent_count(node); if (init->num_parents < 1) { pr_err("dra7 apll %pOFn must have parent(s)\n", node); - goto cleanup; + goto free_ad; } parent_names = kcalloc(init->num_parents, sizeof(char *), GFP_KERNEL); if (!parent_names) - goto cleanup; + goto free_ad; of_clk_parent_fill(node, parent_names, init->num_parents); @@ -223,8 +228,11 @@ static void __init of_dra7_apll_setup(struct device_node *node) cleanup: kfree(parent_names); +free_ad: kfree(ad); +free_clk_hw: kfree(clk_hw); +free_init: kfree(init); } CLK_OF_DECLARE(dra7_apll_clock, "ti,dra7-apll-clock", of_dra7_apll_setup); From patchwork Sun Dec 24 16:40:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504344 Received: from mout.web.de (mout.web.de [212.227.15.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD57F748A; Sun, 24 Dec 2023 16:40:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="LscfqP9U" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703436009; x=1704040809; i=markus.elfring@web.de; bh=VvcPb3zTVCi+fRkNHAv6TVW423QWVXeGKi1oD5ImWcI=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=LscfqP9UCsXC+p+Bea5/LMhWXBrT84uXK4HjQsQ0cZPXo8sOMHm8oYGbm1sC4/5D rFKcYYpIAMwcDmpqDp0W2GxH8DYgYoM7S+Tv7wdlROfKkpw8hrySzW9w7VfqZG2mE 3H3b/dt0O16K5pYQVDxOI8P6kNTBGZHNhtCG4+KaEekxVm9+KyV2Fgr+oNBvRik4Z cQd9BKPVy+tgKEd3F98ICVgsWl3kb9ILRda8BFfpsJDMYNgR6dhlEq5zFRzD89ELg epDbvggFfrq3xfK/HrW5yeo+22ZeIQFYkfUy7dFWTuRL4Z4tLdb3VU9WtD6Vk2/Pj 23P1cNF7oYXckh07xw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MuFD7-1qz4iq1mP7-00u6nC; Sun, 24 Dec 2023 17:40:09 +0100 Message-ID: <159195e8-a382-48ab-8159-0c473ec38ad2@web.de> Date: Sun, 24 Dec 2023 17:40:08 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 03/10] clk: ti: Use common code in omap_clk_register_apll() Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:2vXjRt4bOptLQGsxvaUmJtLomLSQyrX0M9nCcPmXcy1A3BcrvMx ImTo7wCvKnUSbuhzGHn8Ej/JxVfgbh5EWGsN/A7Tq65TzIghgmO83Cx0XabRYjcStueZjdS x9Jv9s3Av3hQBbUba3TyV/g25q2ejgN+eD87Fjnoog/4gOMhR7bXD/Nu37pg+vLmCffVQ4z UbYpjbBXQKaSdkT7RuSVQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:iK6Nj6+3/mw=;zNeXTuolSeAqzD1ZGuX/uvybDV5 CEpxweIH7h0PJMUKWOIJPuUglHdMd/+mx1NSrN6orAW9IDcAVJZ98T8Of0n999ZvGygH7pvNN VDqQbFfYI8v5y1uNgkOoDabS/yW9cg/+q9JGBfnOq6UEtMs7CxcD16vAqUSV8QBqYb8v52f3Q BXl4nQ+Wb1A4vglq18P1w7+8maIEJiQf85+k7uLBeDzX5ej3pltKmTJ13zBr2e0wzvaMcCRev xAKQqD3ilbyHFaljCr6jj/d6q0OQa6j705J4ViqmXD6OpLxjdpjrhuW5x6lMK1NCiCyFUqB4C ZCPaJWbM0J6JSkdEc+UiYJLSRMrmtx6+VUZ09G7qaIwtSToJj38hDeWyn9Un5YzC345KcXwme py8dIzJRCZbZE3uKTBXc0Kq92pJt1Hz2K4iUmGfVHiwwbO6sA9R0g80Kjb+g2WZClfB4x8imJ fm/RVL+faT0yPySu946bORv4QaUP/0PY9DBbhIzpdC/YEzE8Q1ZJSYLuT5gTnEaMKAtf+nUas 8qFaupDaYMCyPVea02m2a9x03LroUUZ0woASD1TK+8mJy620NacERG8A9vQZpOfUX9C28gyBA kH5GvrunioV4J15m+NSMuJGW8k/YXH4G85YXUzdxMRyX3jCVneLUFckjhh6OlC1J7YXE8X7pN cUjkCT8QzQkLYDJJRXv/elB+Z5mjCRM9HBJPH16M8OpLivo8VZM0J3vib/YORV/cHhdQGu0Ho Fv59sOrB2SD8ucAW3uRCeV9Qw5KxSxvXkcO+56uAj4ynUGNWbBLi/IVnpU0rPtaOWJSCuQboO LPE86NV28ny7n7/koMWeuOk49LQJil1ynt1xHy4xEMZYBXpFXzd5NsaU4Nao2DYlV59lsiR22 LM5qzZHFEkQrIcW7Q/L5uEGzM9OEnRPyKZFuosTKH6UDI5EqhKqo02EYUGpQzSzDmnJphKpFV o094AXEJaVkx4Iml7TOh8fs9qvI= From: Markus Elfring Date: Sun, 24 Dec 2023 12:40:59 +0100 Use another label so that two function calls can be better reused at the end of this function. Signed-off-by: Markus Elfring --- drivers/clk/ti/apll.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.43.0 diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c index d2be672521a3..406326883741 100644 --- a/drivers/clk/ti/apll.c +++ b/drivers/clk/ti/apll.c @@ -163,16 +163,15 @@ static void __init omap_clk_register_apll(void *user, clk = of_ti_clk_register_omap_hw(node, &clk_hw->hw, name); if (!IS_ERR(clk)) { of_clk_add_provider(node, of_clk_src_simple_get, clk); - kfree(init->parent_names); - kfree(init); - return; + goto free_names; } cleanup: kfree(clk_hw->dpll_data); + kfree(clk_hw); +free_names: kfree(init->parent_names); kfree(init); - kfree(clk_hw); } static void __init of_dra7_apll_setup(struct device_node *node) From patchwork Sun Dec 24 16:42:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504345 Received: from mout.web.de (mout.web.de [212.227.15.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EA2A746B; Sun, 24 Dec 2023 16:42:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="kI+9RdT9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703436140; x=1704040940; i=markus.elfring@web.de; bh=xPOZJwyuU2nZ40HhhBkd6/p4ub+Ys2PvUwGIEA88uOk=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=kI+9RdT9y3YBcqQmU8AnmSqWOLc9pef+PlVwff+u9XrHAUp3YD4nU8cs2H4/wbD2 /+iH/U+SXwbAu0HfYudpVRZQFq2MufFD8vuFZ7lv2epRmyZGt+VCl38v37dwkYnI9 gqdQfk/pEdykw9n1UhWV/NZAYBxRgLXJaj0OgpSn4Gfl4taJxLdPA1Swlmf+2CtYM 08J62D7gJ1vfdLD0969kVMa3+ShInJn4+spZuGBB2qJ0AKzNuXuOjlFs1FoALrCJz no8P7v/S/dSXEqAZcR65q9nOIJzSHwc/YraTlWreDwL6jUrEVJF9WNE1h2X7vj1cZ HytpbcgdY4qaXz+xfQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M3V6E-1rHzWI0ix8-000z2J; Sun, 24 Dec 2023 17:42:20 +0100 Message-ID: Date: Sun, 24 Dec 2023 17:42:19 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 04/10] clk: ti: Less function calls in ti_fapll_setup() after error detection Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:ZZEXd63kDl+1X6VLV9csl6o6Tolw8zBW2zGW03MPQm51PBoxFmB OfVJrS3T2lRZ+Lpev6rZc7KJj2SZ1I1X4uc208XygpBiixeMxL1gAmfw53gY5AGgV3X6u6U RNxWEGNw2HslqJqOWwC/RimZForGOuPXfYCVgjsioAOo8zx/EI7wCon85BC4ldckoIVZYsV ouKmDtS8wq8lcXtClFGfg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Qc5Akm03OAM=;VwVf1e59LJU+8iW5h/2yXzamYCH +R1xK+oIQ4s5cfz2JO2Pbh1F7norfdph3z3VVExYc+WG6cMRBOuxz6U9AgmPrjy/QzXnDStJ5 Aed7BO1YqnO92NNEbvOr5eUOnx2ejvT7GCzSKKOAIfFH3jGLRlv9Gwq3acYrvvM0R+ojS7QFJ YT6dHTENOF7UYhKSWEntlmCr+Nw9FYgPmyGvirTRkxwdodsaJ1/yTZI19hUlj6sNSKjchyuE2 KouYS5Ahz4RXFW1Iox1NI0NTU0MUWcReio/fcMd8944tCwZLXWrvXcmVSD3zmABFMDqCCS4LG mS46E0er/+akh5PdbwrIdmj11ErJHrI2jJOnD45lf4mFFwvTAeshOs8Y0Tuh8k5dnmURi2R8M 6H3Qt+pHR87c8Z2MDf13y3SC8anYmWgEZmFOcWtqn8MciFhTPLlp+U7oFcZVp0a3d5gH2Ybud LJMKrhLrZeifbcwFkz9pBCUxqxrRE8BbfBG6QI0RzMufKdkHMXiAFaK1oK5pXkftK8PxtSBzi DvoZ00ph9P/cH9ZB7ipBT6+ASEjBXPL8AxmPiL/W9TEfhrhNALwchEXYUfJP0AUzffsv75Ui9 OgPiivc824rL2oi96oI3dAzJW/sujs2Hiz2/Fq/E8e2GS8g/6+CEtzt/sXLOuCScGXuppvQEV pu4LcaHi1+hYNJsYY47/jgYcwiYh/Lyub5sfAGd39d8cBij+UkjJh6awy3K1yOP7++B4HLG/a Jop+KPnIQCBrBunnK6RzyTHAgHPN71PSQN5UfE6xboUd38pGF37AUHc9yBxSONZ7oA8QJ3pFH ONJ6eMVtIQqe55Wc1xq6HR0NvmBilq8slcnUjYakRuP/kX6KbOSFGv4xd7OgAFwjhHvL2/m18 JqXmZIarHlwmhMxWNaC8lhCQTgog1RxoptubxDFTAw/3zYMDT4VNFSA3Uje06J6XhzrW77Zkw VM57DdlWmLQsKsOqABrFmWa7ts8= From: Markus Elfring Date: Sun, 24 Dec 2023 13:55:44 +0100 The kfree() function was called in some cases by the ti_fapll_setup() function during error handling even if the passed variable contained a null pointer. * Adjust jump targets. * Delete two condition checks which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/clk/ti/fapll.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) -- 2.43.0 diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c index 2db3fc4a443e..e9956e3ccd65 100644 --- a/drivers/clk/ti/fapll.c +++ b/drivers/clk/ti/fapll.c @@ -546,11 +546,11 @@ static void __init ti_fapll_setup(struct device_node *node) MAX_FAPLL_OUTPUTS + 1, GFP_KERNEL); if (!fd->outputs.clks) - goto free; + goto free_fd; init = kzalloc(sizeof(*init), GFP_KERNEL); if (!init) - goto free; + goto free_clks; init->ops = &ti_fapll_ops; name = ti_dt_clk_name(node); @@ -559,7 +559,7 @@ static void __init ti_fapll_setup(struct device_node *node) init->num_parents = of_clk_get_parent_count(node); if (init->num_parents != 2) { pr_err("%pOFn must have two parents\n", node); - goto free; + goto free_init; } of_clk_parent_fill(node, parent_name, 2); @@ -568,19 +568,19 @@ static void __init ti_fapll_setup(struct device_node *node) fd->clk_ref = of_clk_get(node, 0); if (IS_ERR(fd->clk_ref)) { pr_err("%pOFn could not get clk_ref\n", node); - goto free; + goto free_init; } fd->clk_bypass = of_clk_get(node, 1); if (IS_ERR(fd->clk_bypass)) { pr_err("%pOFn could not get clk_bypass\n", node); - goto free; + goto put_clk_ref; } fd->base = of_iomap(node, 0); if (!fd->base) { pr_err("%pOFn could not get IO base\n", node); - goto free; + goto put_clk_bypass; } if (fapll_is_ddr_pll(fd->base)) @@ -653,14 +653,16 @@ static void __init ti_fapll_setup(struct device_node *node) unmap: iounmap(fd->base); -free: - if (fd->clk_bypass) - clk_put(fd->clk_bypass); - if (fd->clk_ref) - clk_put(fd->clk_ref); +put_clk_bypass: + clk_put(fd->clk_bypass); +put_clk_ref: + clk_put(fd->clk_ref); +free_init: + kfree(init); +free_clks: kfree(fd->outputs.clks); +free_fd: kfree(fd); - kfree(init); } CLK_OF_DECLARE(ti_fapll_clock, "ti,dm816-fapll-clock", ti_fapll_setup); From patchwork Sun Dec 24 16:44:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504349 Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2CDA746B; Sun, 24 Dec 2023 16:44:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="Hqu4UcUa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703436243; x=1704041043; i=markus.elfring@web.de; bh=Zjk3kgsKNF6CsWK02KUE6jMlFvAiyO4Gho2qFghKcKs=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=Hqu4UcUaOrw87RsWVlIy8U1+gjQ7zfGE6CnY5d8NnAryM6ZNqcB0O2etaNiI7gil nLe9JSwIGKKbFziTZIaisfpKxxwihHyRVhS06ePczm9P8esri1EioaLev/Rvf7P60 wNz0XFn1teJ04zusd7JLkBvlPc6eUtDPtMqP6GyO59OVXrQUDWvive9XRXWbylJCX zGY9Efij+L5VM0hJbUmOUmIZv26olhFxDYXsjYdpiFuZXnXLw420dx/9wrBVMDuV3 Dvy7c/jff6btR+c46RnyFZvfc/Y2QTtcRC6Qr2DE2VnqthWiTRjMyZLS+PwHV0bhq rXmfBr00q1/mmWlJow== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MUU68-1rho8Z23xQ-00QqXu; Sun, 24 Dec 2023 17:44:03 +0100 Message-ID: Date: Sun, 24 Dec 2023 17:44:02 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 05/10] clk: ti: One function call less in ti_fapll_synth_setup() after error detection Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:UBp6FJtixv/LocTBx22eQdkrXLyPsrH437F+wg757/SvLLcqXYi cEP/Ok44Yhwdi7ekjQIre6glYcW+sC41Em43GGSfaWxYTvmnJdlOL+k7MmWacyMyW+PglzD 83qp/H0axL0uPwWYH7ryzKDfB8AqeOxEZFdxhkMo6bJHjQnW7iWlaEvR7Lb4wY39UOuQBk9 YCxNVMKqnnagrbtWG5+/g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:gfIzGhCG8vs=;Af2OqGuJpj6NMu8KvFm8tK6zD3A tMSjSwQhZ0kFr/oqIs5v9QgMNkwIexNV6AZKa8L3YDejI+ReonrbE/QCB7IXb/9wOtRWxqBbm 8ONdmdCoi9njmoOo2LP0gUluXOvG9k3u/L/KLVvDkxFzkdIpT08tai7HmTIt9WMBQmYesr4/z i900TvsAJisZoUvi/x86IG0UIyZ7Zvnw90oGQXqz7Ye7vt5mkao0pI3/zIGXp8FpfWsAN6HNx WRpY7WnPYnzyMajzjLBo5+kNXlIQOJ0Pzfkv/RUZYx/XEr0/V5uhERrXLNOIEQgIz5IJhgcoD MfSi7yw+PQ26Q/6l0c7+cYzZ7h+DtjE32bEDjaQsRHsMLH2bQVdm7J9oTh4pAZCzdyqMq0S7n 0MleTUWEPUs2ziJOhJJV9DIvbP+ruLphXexA6XRKwv4iFzsKTb6FTg4Kd57NJvLJr2/gzsPJ/ PezFow+Z6BVGD0fgys+8ZGWl2DRuUwXf+Xx5h5k1tDF1Yrgp4NRw8XM6kSATJ3DAAtF6RMYdU qKhrg//DcjJRUylaXD/n8k7mX8/2/8u5FQ45N2ZefEC+ZrTpohAPJflEAq4efGB1d4zIWggea 9q7z9nsSKTNhDlidP3eOwo1GdYt2ep+FlOnukcfHQ8mjUuATER/op45ofPG3KAm77nbHCNsil +dGZ5Zi4N4Vru5DYIrfKezZwWxQCmXlBfrFpoPh58blbnKpZaj3pRU7FFev51TVJysgKwtWFO 16HmLNEM2CB67xeJIepYEYO1XZj/7ItI7C22XeTlsysmz9ssEMelp6BDxRnnrntMLE9eZRodJ aguKXMI5AMYZ7860tq1j3ejQUpn5UD5zlwdcrEcXVuLNG06rdwyjDaeRAYY8XXvV66AvEPsLw 4Gf4LE8vQh1IJhK9WFhGhYE9vQ6zVkP0NphVJXQYmfmvPZ5hcm/peO6p2gkCrMAVGM+J6T+3k 9xSjz0kXLH1EoJEMGaF8dMGWMhY= From: Markus Elfring Date: Sun, 24 Dec 2023 14:05:41 +0100 The kfree() function was called in one case by the ti_fapll_synth_setup() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. Thus use another label. Signed-off-by: Markus Elfring --- drivers/clk/ti/fapll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.43.0 diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c index e9956e3ccd65..d4674ec3d7e9 100644 --- a/drivers/clk/ti/fapll.c +++ b/drivers/clk/ti/fapll.c @@ -504,7 +504,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, synth = kzalloc(sizeof(*synth), GFP_KERNEL); if (!synth) - goto free; + goto free_init; synth->fd = fd; synth->index = index; @@ -524,6 +524,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, free: kfree(synth); +free_init: kfree(init); return clk; From patchwork Sun Dec 24 16:45:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504350 Received: from mout.web.de (mout.web.de [212.227.15.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37C10CA64; Sun, 24 Dec 2023 16:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="ocnEnBLv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703436334; x=1704041134; i=markus.elfring@web.de; bh=rIlcz4hsgLr5IuoUvlYO4snd4l8Oh6JPILbZ0XdVhaI=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=ocnEnBLv1ZdoxCh/A5KpMu1pjzoNNj7GkXqDoj73ViELx8GpIH00JTPPdOxHRa27 +95eSoF2bYAnIPbk1evHf9ZD+W8ZTBZdhQN8n6xp0ro4G9HAuTFz/7V6ie3d2mxyo ZJFg43yYkDsBqwnb0YYmQT8bQ45JGW3OATujhKfIC2u0kzrEKsl9qoTH5K7KlDIZa tmxjl6wOivtCyO2Btm0n3HX+TcfluDAj8+9bn5Km77MGVV23wBCKsiMA3oNLfx9+p zSul9G2JGsKOFCqBPDtUAVRiYd5g2YRQQ0LITeu6/sKFrw+6JIeDMyWpAsOYk81AI ToMaBdUk8CGlag0EUQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MsrdM-1qxivW1sCG-00tHXK; Sun, 24 Dec 2023 17:45:34 +0100 Message-ID: <769d269c-126f-477e-a046-d00dcf918829@web.de> Date: Sun, 24 Dec 2023 17:45:33 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 06/10] clk: ti: Return directly after a failed kzalloc() in of_mux_clk_setup() Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:/6OmN1PZ8R/kwCXXkcrmaU8tPWjwWsHBwdPLlxjovbJAPktU2Lg YK8ClV7XYr/8oPrjOf8juijZcJWlPKrpZLrLgVGIUG8JmdMIv8OcWa1i0lUDrbHrgYHN2ye fmdARTQORywVsXaBLECgLCwL7rVaydK4b77WPoAxmQCvO90Rh6HBvaOmwtudqpsmgIr4ZnP tyG94hmLjq8B6otEpK0jg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:7AZ2as5BfFY=;q63bFAXQH93kRNCwv0AIiisgcPQ WeMEgia6QumAjtMsd0rQoCRh/NNdFC7hgcjQHzO2VO/yH3kHCLhcflgvIbK90OjTD77H30uvj v8J8JIdDk2qT3lmGdTBh3rdMBurtS2TiC3VCoFjzbqjE5KQRWIS94/SeLMzkQUFFulrjMWmuc 3zeZ/b7OyQTmaoQtpTF9zEAG1O24zJtLTxqA7zWw3vOYR9Gr6E68V7kAR/sefQywaqH34IwUP c9h9+TXgxKVepF3rSNX6OfYN71T/25YfMZPs4ApZ+8rqbRedzataiDRhDkI1rM3JKH4WfQTB/ yPYQ9b+DgggVVZ51mhC7cUmuq7sXFiOJa9ASoKu6HhhP5GyA3tz4nqUkqKOk95GsZZOm2bcG4 R76F9wxXeI/6VdUc687fhFhPH+MkSVJhZOmUcetSNfmKJSX1ByNCKMeoyux1lsC4AD1JcsjrY hA6gyYUQoUX63+vPqqgHIYbzZiEku0PDWdhH7wtOuzgohuHzOSUdqHtIlVdmiZ0uY2DxxmuuJ v2CXnvEDXwb++vrwchB1AJ+GIPbW3oV6UN0dleVviQq/kPm95LEtLB/6jkSDctrNJWwDVrmEZ d3c0Varl0cuSEzXG+sJESY/7rptoL+kFRavnHteBKqugc6qKHrVFCqQ8KtPeFPUmhgv5ehkzd jn+qvC89l0dVr61wXSR8POyIPzFt0v+PILMyLlOWtuItOn4a9CvKEmbO5e632y06CApGrY+gg pDKQTc2pfGoiLq1FqYAHXyeuO7jpOZs/uh+aZqV5U3pNxkGU1iYvZERV3WLf1PPwZCovmpO8c GhKT3qtTv20qEcLVBbhuXi19IVoHfHbDkhD0oSdhL1Eii6Sn6ofexmrASJ5kWemqQFj8NFusy r5cpMLaKOONESWby/VGzkVrw7G/DFVPXRYGgL3sSH+YBdH3g+6rCEb3m7v6elra7Tzcf5DoAa 8//mPA== From: Markus Elfring Date: Sun, 24 Dec 2023 14:20:18 +0100 The kfree() function was called in one case by the of_mux_clk_setup() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. Thus return directly after a call of the function “kzalloc” failed at the beginning. Signed-off-by: Markus Elfring --- drivers/clk/ti/mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.43.0 diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c index 1ebafa386be6..ab1205fa40d6 100644 --- a/drivers/clk/ti/mux.c +++ b/drivers/clk/ti/mux.c @@ -182,7 +182,7 @@ static void of_mux_clk_setup(struct device_node *node) } parent_names = kzalloc((sizeof(char *) * num_parents), GFP_KERNEL); if (!parent_names) - goto cleanup; + return; of_clk_parent_fill(node, parent_names, num_parents); From patchwork Sun Dec 24 16:47:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504351 Received: from mout.web.de (mout.web.de [212.227.15.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13A6FC8C7; Sun, 24 Dec 2023 16:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="Be00ZAz0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703436421; x=1704041221; i=markus.elfring@web.de; bh=EoQGOCcDaM4+Ixsw81K6brIiYRjh/R6KiMGIqZjOQN8=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=Be00ZAz0q80WOxH/zPlihloDIsoIBArOTi+T2sigd+FI/ks9dQTzpLWb0r4DfMQk HKVgew8rCCPHvDhdCPqB9gSBzVl1ygcAawL6Msux7QdNDjS5QMTW+x4/sChiUtF9z tnEk3kqAkwjXlNfgid5Lb3efYOCZse9VkgGwffuIftQgbCRMXqlD0ykKRzFFm496s 1vLamSoTZYSfpBwYioTDHcQ3+tjd9nvx3KyG/d7X4ccOWB3F+VmX0795OZ1Wzi++6 5AU6rjWg/ispq9qPECjZNt/m7J7y7COh3xxaa2afBjQnxOEIxIlhHKydRJO3crucq /ftkPfOYOp96Je2/vQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M91LW-1rNWAl0ZMs-006YG8; Sun, 24 Dec 2023 17:47:01 +0100 Message-ID: Date: Sun, 24 Dec 2023 17:47:00 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 07/10] clk: ti: Less function calls in _ti_omap4_clkctrl_setup() after error detection Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:mT4mgdDbP7kJOD75VlWL+dv/P6+ReJspjNxOXgs+MnT/XZ5861g ByvEFoUqQtzEYGsLC/Ehh50iodVxf8js+XDAzsuDLuyDMnTzUI7ONqdDUsCm2v2/EVbFr3b GPxVApgwAeFIrdYETA9PRtiVQMT5eQOX2Sq+FcBSTbYz8v1N61AMVv7CcOeQuu13ZRvcjPr AxrlzZeNRBfowBg3Awxgw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:rJk7DYD2fyc=;i3/9r49VTokzDt6oWsAGi0UsBe7 ie8E5hQQMgVmqqdrnGnfFhpb+zaw/VnJiCM8Im8uJf1FBFvRffxnUKufpDjboz76cXTsyKcPv bUcFf11uv5lbiulCFSneINgBwuUCFO/YW28uQZI3ANT/9eJUpSP9RviWFLsjiWpycWgRwakqM 42XXgW+gCtKK0bOETVAiwCPa291I5i+svqQ17eQaZy8Age//4JKVRyOwe6AygCEB+biL6xSGq 5EIASH1dSuvt9B6rVlghxAm9snl23j6XxlXDGFZI5sK8M9LQ/vOkB1kjfXuLbCVmzWWWf2tk+ aqC8rW2FGnQNyWFzZNBYTGCoF/cssqhrvRXnMN8QC/ZSvt2/hU1aaK/6+4onzNpnMZp9JXeHv KkRcempGQjxPu+8oZZtd3+iz2C4iArW1bkPGzN4OuswWNXSIMX2TsWpeW8ixvKHeM9fzevqbE 9QMeSpC1Yepvx2VwWYnHnVJqI0/rJGDThQe91Vv23saZwEWwqaBOOAUa9m/tcK40IUoC2qvSN yX+HHl+7yvfBphl/LuBhseTHeXbm3JAIqcwnRcNAcqeniWQ41Nz6MIBGzhVydYc5/XafrTWxN E1NpiEeB/we1aXBFgL31D1pDePENH3wtHFlzSlkSpVtx4pQjkvX5NVDdp+Q6QKhlRyduy4LoC SE3182wree+QWi5w9IJC8iT0AORRbhViKAHkveyvZKMkfGsIe9SKtLzYLwiGW9Q3JnxGX5Azj cj4kk4fWkVrny/8AHQl93iLUPlUqmf7XmO861k17WZQq56YF3fZO8xJ3Yu9c7mS4ASn3x7oEy zZIRln9eMIPDZSPVxBTDniYByQat1lbbLZjTqjm7dXZMAP2/tKVRGRXBvrWvuPBHZM/yFSy/D qmbmldUF3B1nnPFeDxie3mE4e15tb1A+OzqErT5HktLrWZ142sjgk/cLrAg77gDCVBi5IcuFg BIN0Ag== From: Markus Elfring Date: Sun, 24 Dec 2023 15:46:04 +0100 The kfree() function was called in a few cases by the _ti_omap4_clkctrl_setup() function during error handling even if the passed variable contained a null pointer. Thus adjust jump targets. Signed-off-by: Markus Elfring --- drivers/clk/ti/clkctrl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.43.0 diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 607e34d8e289..82b48548818b 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -681,11 +681,11 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) reg_data->offset, 0, legacy_naming); if (!init.name) - goto cleanup; + goto free_clkctrl_name; clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL); if (!clkctrl_clk) - goto cleanup; + goto free_init_name; init.ops = &omap4_clkctrl_clk_ops; hw->hw.init = &init; @@ -711,10 +711,12 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) return; cleanup: - kfree(hw); + kfree(clkctrl_clk); +free_init_name: kfree(init.name); +free_clkctrl_name: kfree(clkctrl_name); - kfree(clkctrl_clk); + kfree(hw); } CLK_OF_DECLARE(ti_omap4_clkctrl_clock, "ti,clkctrl", _ti_omap4_clkctrl_setup); From patchwork Sun Dec 24 16:48:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504355 Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F02A748A; Sun, 24 Dec 2023 16:48:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="BQC3R0l4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703436502; x=1704041302; i=markus.elfring@web.de; bh=fer0npM9x++5IlF6KQWWoivekp1DBR9tflb/ZiR/dXA=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=BQC3R0l4dJB7droV1PcxJ+qkpaEfjBV2qiJVn8WPDTj++zBskW+qj84vAhhe8VpO 1bWOnjqdNPGZ6e0RwBtOtVRtGKyYv6ISDt24/6C6Ro+y64de+yzKATIZh2SbMDcs7 aQ1PWPDMRPDkwf838+4StruLz866jebSr5ErD2wXHPlu8NX2nWyo4tpvBL49WVB3y RnSwdMabDCR+6DIxqx+Jp5XvZrfml8q9C+Bq+bNUoWa4Rh7evq1mEwMtn4nYpthwL dBq5WWY4crTOUmvR2UDDcuDARFptvAJ4DOpwiqVFUmZrUooSclmhtaVgYy4Mw8Dv/ XeP+oFk0em+uOxwlTg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M3V26-1rHzsd3QJO-0011xE; Sun, 24 Dec 2023 17:48:21 +0100 Message-ID: <0a9cd717-0909-4bc2-b78c-73fe9f661156@web.de> Date: Sun, 24 Dec 2023 17:48:20 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 08/10] clk: ti: Use common error handling code in _ti_omap4_clkctrl_setup() Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:eokwazI7oC0F6W7Kup8Jd63Lo0nLI7yBgMcHCMI9YWI79wiE0SJ LENS88H4VP2YwYihRAUtWIUnURHjK+pf2+EVgeC7zVnUOARgsOpjl62NfuZJScXfcVTMiHc 0aGZ1S8LmPh7rQaTcgQhPVGqTQob2YhOMBDkI/ijlBCvY0BJ/ILKvZj6x2OwwR2EAp9TqEE 8PDAGQQFBnyEUQiI+k7kQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:0yddZSuIJUw=;rcgSNkMomWPs6nh+rAyPw7L1Z44 UAnRXoW+vxvufYZjwR/FJpdnYBKVzzdk9buA6iM3KJU7D8w3tkPpRDOHBEfiS5ZWYvaHhT+CO SZfP/vKfb7yIO1l1cF3SLxRgc7fFuprB/egnqbYp1GwzrRwVo4Q84vjhDfkBlcTCdIuizu7oc v5QX1+nsltp2qgNJc+YWfBxz6pZZhooBZbUJM57lfRi53FNqV4WzKMfb0K8lyJrCMibKHPdUA JsvIPX6LVa5sKI7ja3A6fsAWybmA4xLCBMH/tIc5rpeufnN9JcnCSNNUPHeANr05kwztSX6C3 9QU5SbAni+G5nnW/O9bJaa903G1e1bzWlaoNNAYt5RuYY5Dh266cM8XTrGd26nV5gyTDe5B7l 14WiIXuovalBBYnc2sw7qT8YePtvlqHAhS0Z9hPS7T0HsXD3x9bkw/A20Dd/WV//FPtFcDXwe NG7/0+gfiEbjK0Ou/HFZrbNnPon6+g+x7OsmeDh8AOtdw7xlBmFrWkDTqXsGBXJHGfjE5kYEO 56Sj78TrZdLarSYvzOYA1yZ4S4YtUMWS//mLHE4UkB3zOSAUFtFZ933m4+OLsLvm3jlRlTPWC bflCmWZPchcmKruzvoaRTyI6eUn90b5mE0IWHszIapFIhp5mP+sfhaama9e9x+5aHdqnHfxec 2PfJB6J8ZZuUjUIQ0rk3xBqeHkFPFbLqKAWN6N2j+ebIAC3OBClaP/5ek5s3BsS3QcISAjSZt pHxraHXyP5m7BmPU8JCKwsml6dHIh1gEnTfS0y7t9OWcDJLljnL2PsXU6EQxvieayVVm++yI3 UHPYBTgikwByklR6dG7d29BR8nv83tzvQDfPQaq148MWgs3Rvhmplm1fIyZeeUFBiy5agFECc kcH0Fhq8HyObSaPTLXxjwOQfl+uV5keFPpu7HnvCB1DpivtJgZFY0VXCqw071vNvd/9QdLUjT 7ep7ng== From: Markus Elfring Date: Sun, 24 Dec 2023 15:56:08 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring --- drivers/clk/ti/clkctrl.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) -- 2.43.0 diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 82b48548818b..5a1bd176160c 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -590,10 +590,9 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) if (clkctrl_name) { provider->clkdm_name = kasprintf(GFP_KERNEL, "%s_clkdm", clkctrl_name); - if (!provider->clkdm_name) { - kfree(provider); - return; - } + if (!provider->clkdm_name) + goto free_provider; + goto clkdm_found; } @@ -603,10 +602,8 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) */ if (legacy_naming) { provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFnxxx", node->parent); - if (!provider->clkdm_name) { - kfree(provider); - return; - } + if (!provider->clkdm_name) + goto free_provider; /* * Create default clkdm name, replace _cm from end of parent @@ -615,10 +612,8 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0; } else { provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFn", node); - if (!provider->clkdm_name) { - kfree(provider); - return; - } + if (!provider->clkdm_name) + goto free_provider; /* * Create default clkdm name, replace _clkctrl from end of @@ -710,4 +705,8 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) return; +free_provider: + kfree(provider); + return; + cleanup: From patchwork Sun Dec 24 16:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504356 Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6112B79E5; Sun, 24 Dec 2023 16:50:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="jGND4Y9I" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703436643; x=1704041443; i=markus.elfring@web.de; bh=QWfrLn5Mvq6EClrCdDR9YcOT+EUQjWH56hvUXCNkDTo=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=jGND4Y9IkHAqEg8K4v4mIC6aIbTEe1Uas731nInK8zy0ZcCzTY49LdfFIN1go8ZW Abnf5nEK1Ddy0PlNpMcwgr3IbNJcFzHTK1Roj1m+Qn5OHuGVs7uhC0ZW2cV8Xxi7q kRsQmYlV2l07IMjeOaqRx9yXYiIyLG0MfGU4Wz7MMeHxUpz+vu5xyGsnb3cFAqMa3 euIAFisPQWRcEKHtGa1irfcEgL31RXDhG4zc8/ZADELBqD2tL0gaE31btDACBWcp4 D2iVi9rUlTxuEYZi808tP+FacL1d/N4qQ3F5/FW4pIbR1YqTxJ2cMfVA3xUrVz4+o 5kF7eaXVXOqQ4MsKuQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MtyA4-1qypRP30ai-00uSde; Sun, 24 Dec 2023 17:50:43 +0100 Message-ID: Date: Sun, 24 Dec 2023 17:50:42 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 09/10] clk: ti: Less function calls in _ti_clkctrl_clk_register() after error detection Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:/MWeLp3bl5k34XvHfUI/W2lEnDBpqKjkeUU/BEXyT8r+Vr6kXuW JYz6AV7/4XrRs/G+WutGLHoSbx3hEdcxD2epWe7JxWXQy84XynjtfQsvXuXobN8Di7EBNIL hLQVGXzSJhu3uXEemeWbbf54hrJsAaZb4ualaE/1rrEJJ+pxVgoiRCxqOmeCJevBn5RHYFe 6WWYY+6KdYDsUZKQ9TvkQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Hj4f7rq9WDs=;5Np9XTbAJN9ju3o5KWqwGcQaRfV FwzOFVEUh3j4f+NVlPqWktWkN2BjHcej/W9EavpqEfF+LehycYYBa3Lamy1GsNyaiKPVTFWKI 1xDr2+WignlNX1ZZz18UcW5Nsrvx31+vW7I37liaKDaf3GgPtXC32li8fuJhSquJLZ0kRT9hs QylzSF/HsxauthrLGkM6fJK0Ob2reR5YPGTPvIZkBr7959ZG9uwgsc3i20fj23jLFQIHuPzYP 0O0N/kyAtIE3sJyXlrNxG7+JkR70vl9nsnq21VpEMrS9G0zDecO0TDBXSxupJOQkc91YhpCIO snE9VEaP2nFlJP6izdvGXotTOqi8vl69htKAuCcoGe8O7d2KqMgfN8HcN3oBTOePTTec/lvPV jnkh4n8AxTxD5hHTKnCABwiBkwT8Y4TsKs2pC6407r52AS3YYLyeYdgsXC/vyoYZMxjpNUv79 sOvoOWYRrO3wTBKBoll04BhVV9TzXruwsq8k3WwUbD6aXArCuVjcpGpw3awTMZAjUgi9CLzsu 0GP4hIAwy50GUPHSPIKluo9v4w6w9vdwnO4h4U84rgwqFVr8fgmGT+7uqJyXm5EJqm8vZvD7I qg4RViMGHVuZt46+pGHa6FvfzRk8uOH86WqqIhXRQ5FHAAtQLdlGftRxoA6sotCT5YVWOw0R9 Q7lVahjVV4LeyFl+WInH5R/bBBxNQlKo0sXdAqv2wp+KbgbCGAXg55m3B15pwqghhwzY985Bn oU9Bkbf8JLjB7QhVmZANidHRQF3k/yW8Zd/Uyx6Pnz8Catp3lNuKkRQxRk95GK/bDVMhgwg9e zbaPDIorLQ25DUl13YrPB17nK5bWCv/tRV6Uab726rVrQ4zvjAU85arVBT0aqp2A2lCYy2RC3 XU3JgEN5bKJEEGYjIzfE7hpgbKFyiZaFH3wDV4HffeaUl0jtLXj2Zsv610tErma89RdfTx58p 8pH+vQ== From: Markus Elfring Date: Sun, 24 Dec 2023 16:06:34 +0100 The kfree() function was called in a few cases by the of_omap2_apll_setup() function during error handling even if the passed variable contained a null pointer. * Split a condition check. * Adjust jump targets. Signed-off-by: Markus Elfring --- drivers/clk/ti/clkctrl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.43.0 diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 5a1bd176160c..cdc3cf1ddddf 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -296,11 +296,13 @@ _ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider, init.name = clkctrl_get_clock_name(node, clkctrl_name, offset, bit, ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT); + if (!init.name) + return -ENOMEM; clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL); - if (!init.name || !clkctrl_clk) { + if (!clkctrl_clk) { ret = -ENOMEM; - goto cleanup; + goto free_init_name; } clk_hw->init = &init; @@ -324,8 +326,9 @@ _ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider, return 0; cleanup: - kfree(init.name); kfree(clkctrl_clk); +free_init_name; + kfree(init.name); return ret; } From patchwork Sun Dec 24 16:52:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13504357 Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA5D9C8C4; Sun, 24 Dec 2023 16:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="R3f2pxMt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703436732; x=1704041532; i=markus.elfring@web.de; bh=JVdUzdLpgaC7hin98rECoi2XLdapoOWFd5N0xpU61Ps=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=R3f2pxMtgGsapI2wHzZEJ6wtTmgobGpUwnMfkpJ4NY+T+PUQxcjMUTQrQ6C5WH72 Vc7AWqorzLtIxE8KsqCaPGzh7Bm0u3kxLd0jyQB5zTVRST4+g16ul3AxOTPHTg73J +UnnY4brCUC++ti/y2xpawndiOX5prxyHzAKpUSo9ppJN/bq6fTMOGajdxC84qvAC VkJ3jPVudtR/zTZNI2dKK+BZw6R2GMIaoRGhMvGuLw6Npochihs6XyxekF3zVHLhc 7bgaboOhIqxBi1QR/R7sLs9VkL1MvH0mm9/uWL+BXRkhux2ZriNes31ydTYzI/x5A CccQ2nsGKhy/x6C3Eg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MQgp0-1rf389465e-00O91k; Sun, 24 Dec 2023 17:52:12 +0100 Message-ID: <8f58f1c4-3fdb-49ed-b747-5e1a4852875a@web.de> Date: Sun, 24 Dec 2023 17:52:10 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 10/10] clk: ti: Delete an unnecessary initialisation in _ti_clkctrl_clk_register() Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Claudiu Beznea , Michael Turquette , Rob Herring , Stephen Boyd , Tero Kristo , Tony Lindgren Cc: LKML , cocci@inria.fr References: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> In-Reply-To: <20849a8e-e0f5-46df-ad8a-9eae6cbe337b@web.de> X-Provags-ID: V03:K1:fgN0ExXBwyzGUMbTgjTQTsyg844rAOWLjjsZLqPYyF+g0El0wjS fpdJ3gzSpTdZjq3ca1tmrQTdzYiAQSHKYsU90V6eMg2QY36o/KHmAB+nJo40lWPx/hyclBB dFFLiAJETpj76bkIKBCB7lqaRwF9GFsMBiKg9quyxL/ojHx2GhbW9iEvjMHGQy4cZ8EhTrr 26Phs5wT05dErm3m7QyvA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:m0YkNs4BJnc=;rLK0KQfeIZqGmWNAPNEF+Fnjc/+ oIoU2FJwEEhd+GLZENUUL3z/llOdruLcq85PAZYcVTQYxKEkpP55ADk09wwocDbFDjHXyw8N8 BK3CP5bZ5Q7s+0XOyEOy3Q197VJuugi7AE1xaE4WaxTu3x92HUdbnPhzBXpmHJukZrQ2acMQW Sr6dnLeliQMN1wCh24yKIiMwao4mAfofzfiaqCiQVNZSretEUX8psBH1lpvWIor+hDGayYo6T AJhZdDoNPctqvUlf9J02eGBrEzarYsrICUjd0CHEGetZpPJ74glzK82UouT//U9zldv0xQipQ t7Pzzww9z27xIaszolzIRn0OUA4Kn2nFfz8Um7tEm6q7yaDXQGtD53RmBPfaIcYjEcWsxKMbg HX4lpZnHVLy1v0DobKBKhhqkcancJZT0eByg2wPZGbgfyAXJJyTe7LRCLB14quu3WAiqSDaHf JdqX6ZJ2Slhh3srMA4GK2J0Co1XRnwB4hnTGXuQ1vdad/TL+aJCG/xnae7vGRcgK+9lsIsayu zTb6fjsnlM3Idk40ohL5HoexwHx6D6A02Z3xWi6vX3hP4niUQn7+v3KV3oUCKE+8aKl3x+vbE 8C+IkVjk2guVTSrahTh0rOmoyz3uBDcQ8t+HOYb3y0ykJXEBvnwkDZUDg1frwWUtle30Rlkdb NyP/9CYeBxEbtrRX67KQA1MIRz1t5f/X5TCpb18XYqlu7vUAmIfYaBOhwhx7YCG5BCpF+iyUY VH/1qWQIIvBdkt5heHnXdS5NLJ02BxM3YEWo8Gk5BomVWKDogPIuLdOgE3NrtcKqe9Czj1L7G m6Ga35Eic9iqfZDBM1sVQhSC6qObIOIryqDUpur7KI1ut0z863hr3A/52l6+N6TxFBv9IEX5b ml8tZTKg/VgpedtZijJBMLo8IK5+sdmhEsjYDrSlFcrT/1R0UTZRX3cO7pfiNAaZK9JmSyyMI ROIhxg== From: Markus Elfring Date: Sun, 24 Dec 2023 16:27:33 +0100 The variable “ret” will eventually be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/clk/ti/clkctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.43.0 diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index cdc3cf1ddddf..b9df75c6cc50 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -291,7 +291,7 @@ _ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider, struct clk_init_data init = { NULL }; struct clk *clk; struct omap_clkctrl_clk *clkctrl_clk; - int ret = 0; + int ret; init.name = clkctrl_get_clock_name(node, clkctrl_name, offset, bit, ti_clk_get_features()->flags &