lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220718130612.3122982-1-cuigaosheng1@huawei.com>
Date:   Mon, 18 Jul 2022 21:06:12 +0800
From:   Gaosheng Cui <cuigaosheng1@...wei.com>
To:     <cuigaosheng1@...wei.com>, <srinivas.kandagatla@...aro.org>,
        <gregkh@...uxfoundation.org>, <rafael@...nel.org>
CC:     <linux-kernel@...r.kernel.org>, <gongruiqi1@...wei.com>,
        <wangweiyang2@...wei.com>
Subject: [PATCH -next] nvmem: node: using put_device to replace kfree_const

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ