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

* Re: [PATCH -next] nvmem: node: using put_device to replace kfree_const
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-07-18 14:22 UTC (permalink / raw)
  To: Gaosheng Cui
  Cc: srinivas.kandagatla, rafael, linux-kernel, gongruiqi1, wangweiyang2

On Mon, Jul 18, 2022 at 09:06:12PM +0800, Gaosheng Cui wrote:
> 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 +-

Please slow down.

Your subject does not match the file name you changed.  Stop and wait a
few days, fix up your patches based on the review, and send a patch
series and then wait for others to review them.

While you wait, take some time and review patches from others, so that
you can get some experience here.

good luck

greg k-h

^ 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®