[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190919092641.4407-2-l.luba@partner.samsung.com>
Date: Thu, 19 Sep 2019 11:26:40 +0200
From: Lukasz Luba <l.luba@...tner.samsung.com>
To: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Cc: b.zolnierkie@...sung.com, krzk@...nel.org, kgene@...nel.org,
mark.rutland@....com, robh+dt@...nel.org, cw00.choi@...sung.com,
kyungmin.park@...sung.com, m.szyprowski@...sung.com,
s.nawrocki@...sung.com, myungjoo.ham@...sung.com,
willy.mh.wolff.ml@...il.com, dan.carpenter@...cle.com,
Lukasz Luba <l.luba@...tner.samsung.com>
Subject: [PATCH v3 1/2] memory: samsung: exynos5422-dmc: Fix kfree() of
devm-allocated memory and missing static
Fix issues captured by static checkers: used kfree() and missing 'static'
in the private function.
Fixes Smatch warning:
drivers/memory/samsung/exynos5422-dmc.c:272
exynos5_init_freq_table() warn: passing devm_ allocated variable to kfree. 'dmc->opp'
Fixes Sparse warning:
drivers/memory/samsung/exynos5422-dmc.c:736:1:
warning: symbol 'exynos5_dmc_align_init_freq' was not declared.
Reported-by: kbuild test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Reported-by: Krzysztof Kozlowski <krzk@...nel.org>
Signed-off-by: Lukasz Luba <l.luba@...tner.samsung.com>
---
drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index 8c2ec29a7d57..1b54fc8c912e 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -258,7 +258,7 @@ static int exynos5_init_freq_table(struct exynos5_dmc *dmc,
opp = dev_pm_opp_find_freq_floor(dmc->dev, &freq);
if (IS_ERR(opp))
- goto err_free_tables;
+ goto err_opp;
dmc->opp[idx - i].freq_hz = freq;
dmc->opp[idx - i].volt_uv = dev_pm_opp_get_voltage(opp);
@@ -268,8 +268,6 @@ static int exynos5_init_freq_table(struct exynos5_dmc *dmc,
return 0;
-err_free_tables:
- kfree(dmc->opp);
err_opp:
dev_pm_opp_of_remove_table(dmc->dev);
@@ -732,7 +730,7 @@ static struct devfreq_dev_profile exynos5_dmc_df_profile = {
* statistics engine which supports only registered values. Thus, some alignment
* must be made.
*/
-unsigned long
+static unsigned long
exynos5_dmc_align_init_freq(struct exynos5_dmc *dmc,
unsigned long bootloader_init_freq)
{
--
2.17.1
Powered by blists - more mailing lists