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: <1241791284-11490-3-git-send-email-Geert.Uytterhoeven@sonycom.com>
Date:	Fri,  8 May 2009 16:01:11 +0200
From:	Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com>
To:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:	cbe-oss-dev@...abs.org, linux-kernel@...r.kernel.org,
	linux-fbdev-devel@...ts.sourceforge.net,
	Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com>,
	Jim Paris <jim@...n.com>
Subject: [PATCH 02/15] ps3vram: Use proc_create_data() instead of proc_create()

Use proc_create_data() to avoid race conditions.

Reported-by: Alexey Dobriyan <adobriyan@...il.com>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com>
Cc: Jim Paris <jim@...n.com>
---
 drivers/block/ps3vram.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 2e79d2c..6e73868 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -546,12 +546,10 @@ static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev)
 	struct ps3vram_priv *priv = dev->core.driver_data;
 	struct proc_dir_entry *pde;
 
-	pde = proc_create(DEVICE_NAME, 0444, NULL, &ps3vram_proc_fops);
-	if (!pde) {
+	pde = proc_create_data(DEVICE_NAME, 0444, NULL, &ps3vram_proc_fops,
+			       priv);
+	if (!pde)
 		dev_warn(&dev->core, "failed to create /proc entry\n");
-		return;
-	}
-	pde->data = priv;
 }
 
 static int ps3vram_make_request(struct request_queue *q, struct bio *bio)
-- 
1.6.2.4

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