mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] nvmem: node: using put_device to replace kfree_const
@ 2022-07-18 13:06 Gaosheng Cui
  2022-07-18 14:22 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Gaosheng Cui @ 2022-07-18 13:06 UTC (permalink / raw)
  To: cuigaosheng1, srinivas.kandagatla, gregkh, rafael
  Cc: linux-kernel, gongruiqi1, wangweiyang2

We should never be touching the name pointer of a kobject
directly like this, the device structure itself should be
cleaning up the memory, not a kfree_const, so using put_device
to replace kfree_const.

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
 drivers/base/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index 0ac6376ef7a1..dd2c6089bed1 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -154,7 +154,7 @@ static struct node_access_nodes *node_init_node_access(struct node *node,
 	list_add_tail(&access_node->list_node, &node->access_list);
 	return access_node;
 free_name:
-	kfree_const(dev->kobj.name);
+	put_device(&access_node->dev);
 free:
 	kfree(access_node);
 	return NULL;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-18 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 13:06 [PATCH -next] nvmem: node: using put_device to replace kfree_const Gaosheng Cui
2022-07-18 14:22 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®