[<prev] [next>] [day] [month] [year] [list]
Message-ID: <06630f9ec3e153d0e7773b8d97a17e7c53e0d606.1727375615.git.christophe.jaillet@wanadoo.fr>
Date: Thu, 26 Sep 2024 20:33:49 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Georgi Djakov <djakov@...nel.org>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-pm@...r.kernel.org
Subject: [PATCH] interconnect: Remove a useless kfree_const() usage
"path->name" is allocated in of_icc_get_by_index() using kasprintf(), so
there is no point in using kfree_const() to free it.
Switch to the more standard kfree() to free this.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
Compile tested only.
This is not a bug fix.
kfree_const() works fine here, but is useless. It is equivalent to kfree().
Before commit 1597d453289b3 ("interconnect: Add of_icc_get_by_index()
helper function"), using kfree_const() was needed.
For the records, this patch is a clean-up effort related to discussions at:
- https://lore.kernel.org/all/ZvHurCYlCoi1ZTCX@skv.local/
- https://lore.kernel.org/all/20240924050937.697118-1-senozhatsky@chromium.org/
---
drivers/interconnect/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 7e9b996b47c8..8a993283da82 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -808,7 +808,7 @@ void icc_put(struct icc_path *path)
mutex_unlock(&icc_bw_lock);
mutex_unlock(&icc_lock);
- kfree_const(path->name);
+ kfree(path->name);
kfree(path);
}
EXPORT_SYMBOL_GPL(icc_put);
--
2.46.1
Powered by blists - more mailing lists