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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130416182639.27773.60503.stgit@warthog.procyon.org.uk>
Date:	Tue, 16 Apr 2013 19:26:39 +0100
From:	David Howells <dhowells@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	devel@...verdev.osuosl.org,
	Mauro Carvalho Chehab <mchehab@...hat.com>,
	Jerry Chuang <jerry-chuang@...ltek.com>,
	linux-wireless@...r.kernel.org, viro@...iv.linux.org.uk,
	linux-fsdevel@...r.kernel.org
Subject: [PATCH 12/28] rtl8192u: Don't need to save device proc dir PDE [RFC]

Don't need to save the PDE of a directory created under /proc/net/rtl8192/ as
we can use proc subtree deletion to get rid of it and all its children.

Signed-off-by: David Howells <dhowells@...hat.com>
cc: Jerry Chuang <jerry-chuang@...ltek.com>
cc: Mauro Carvalho Chehab <mchehab@...hat.com>
cc: linux-wireless@...r.kernel.org
cc: devel@...verdev.osuosl.org
---

 drivers/staging/rtl8192u/r8192U.h      |    1 -
 drivers/staging/rtl8192u/r8192U_core.c |   18 ++++++------------
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h
index e538e02..bedeb33 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -946,7 +946,6 @@ typedef struct r8192_priv {
 	/*stats*/
 	struct Stats stats;
 	struct iw_statistics wstats;
-	struct proc_dir_entry *dir_dev;
 
 	/*RX stuff*/
 //	u32 *rxring;
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index d81d7d5..27ba2a3 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -669,20 +669,19 @@ static const struct rtl8192_proc_file rtl8192_proc_files[] = {
 void rtl8192_proc_init_one(struct net_device *dev)
 {
 	const struct rtl8192_proc_file *f;
-	struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
+	struct proc_dir_entry *dir;
 
 	if (rtl8192_proc) {
-		priv->dir_dev = proc_mkdir_data(dev->name, 0, rtl8192_proc, dev);
-		if (!priv->dir_dev) {
+		dir = proc_mkdir_data(dev->name, 0, rtl8192_proc, dev);
+		if (!dir) {
 			RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n",
 				 dev->name);
 			return;
 		}
 
 		for (f = rtl8192_proc_files; f->name[0]; f++) {
-			if (!proc_create_data(f->name, S_IFREG | S_IRUGO,
-					      priv->dir_dev,
-					      rtl8192_proc_fops, f->show)) {
+			if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
+					      &rtl8192_proc_fops, f->show)) {
 				RT_TRACE(COMP_ERR, "Unable to initialize "
 					 "/proc/net/rtl8192/%s/%s\n",
 					 dev->name, f->name);
@@ -694,12 +693,7 @@ void rtl8192_proc_init_one(struct net_device *dev)
 
 void rtl8192_proc_remove_one(struct net_device *dev)
 {
-	struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
-
-	if (priv->dir_dev) {
-		remove_proc_subtree(dev->name, rtl8192_proc);
-		priv->dir_dev = NULL;
-	}
+	remove_proc_subtree(dev->name, rtl8192_proc);
 }
 
 /****************************************************************************

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