From: Lukasz Luba Date: Thu, 19 Sep 2019 09:26:40 +0000 (+0200) Subject: memory: samsung: exynos5422-dmc: Fix kfree() of devm-allocated memory and missing static X-Git-Tag: v5.5-rc1~40^2~20^2~1 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=d51e6a69f4e9e81cf75bbfdccce60d47e31ad901;p=linux.git memory: samsung: exynos5422-dmc: Fix kfree() of devm-allocated memory and missing static Fix issues captured by static checkers: use of kfree() on resource-managed memory 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 Reported-by: Dan Carpenter Reported-by: Krzysztof Kozlowski Signed-off-by: Lukasz Luba Signed-off-by: Krzysztof Kozlowski --- diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c index ac5f55813900..0fe5f2186139 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) {