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:	Mon, 07 Oct 2013 12:43:41 -0500
From:	Larry Finger <Larry.Finger@...inger.net>
To:	gregkh@...uxfoundation.org
Cc:	linux-kernel@...r.kernel.org
Subject: [RFC] Add inline routine to free memory used in kobject name

At present, if one wants to free the memory allocation used for
a dev->kobj name, it is necessary to go quite deeply into the structure.
To avoid this much dependence on the structure details in driver
code, a new inline routine is created.

Signed-off-by: Larry Finger <Larry.Finger@...inger.net>
---

Index: wireless-testing-save/include/linux/device.h
===================================================================
--- wireless-testing-save.orig/include/linux/device.h
+++ wireless-testing-save/include/linux/device.h
@@ -27,6 +27,7 @@
 #include <linux/ratelimit.h>
 #include <linux/uidgid.h>
 #include <asm/device.h>
+#include <linux/slab.h>
 
 struct device;
 struct device_private;
@@ -789,6 +790,11 @@ static inline const char *dev_name(const
 	return kobject_name(&dev->kobj);
 }
 
+static inline void dev_free_name(struct device *dev)
+{
+	kfree(dev->kobj.name);
+}
+
 extern __printf(2, 3)
 int dev_set_name(struct device *dev, const char *name, ...);
 
--
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