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]
Date:	Sun, 21 Jul 2013 11:34:59 -0400
From:	David Graham White <dgwhite11@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	gregkh@...uxfoundation.org,
	David Graham White <dgwhite11@...il.com>
Subject: [PATCH] drivers: base: core: Removed superfluous calls to put_device in device_destroy and to kobject deletion functions in device_del.

When device_destroy is called and the device's embedded kobject may be removed,
this would occur with the call to put_device in device_unregister. Further,
put_device should take care of cleaning up the kobject without the need to
call kobject_del indepenedently in device_del.

Signed-off-by: David Graham White <dgwhite11@...il.com>
---
 drivers/base/core.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 8856d74..d6494ee 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1292,9 +1292,7 @@ void device_del(struct device *dev)
 	 */
 	if (platform_notify_remove)
 		platform_notify_remove(dev);
-	kobject_uevent(&dev->kobj, KOBJ_REMOVE);
 	cleanup_device_parent(dev);
-	kobject_del(&dev->kobj);
 	put_device(parent);
 }
 
@@ -1849,10 +1847,8 @@ void device_destroy(struct class *class, dev_t devt)
 	struct device *dev;
 
 	dev = class_find_device(class, NULL, &devt, __match_devt);
-	if (dev) {
-		put_device(dev);
+	if (dev)
 		device_unregister(dev);
-	}
 }
 EXPORT_SYMBOL_GPL(device_destroy);
 
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ