From patchwork Fri May 8 14:01:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 26998 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 877CDB7067 for ; Sat, 9 May 2009 00:02:17 +1000 (EST) Received: by ozlabs.org (Postfix) id 37DABDE22D; Sat, 9 May 2009 00:01:50 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 36117DE22C for ; Sat, 9 May 2009 00:01:50 +1000 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from pophost.sonytel.be (vervifontaine.sonytel.be [80.88.33.193]) by ozlabs.org (Postfix) with ESMTP id 4FE11DDE06 for ; Sat, 9 May 2009 00:01:30 +1000 (EST) Received: from vixen.sonytel.be (piraat.sonytel.be [43.221.60.197]) by pophost.sonytel.be (Postfix) with ESMTP id 3010A44483; Fri, 8 May 2009 16:01:24 +0200 (CEST) Received: from geert by vixen.sonytel.be with local (Exim 4.63) (envelope-from ) id 1M2Qdi-00030H-9s; Fri, 08 May 2009 16:01:26 +0200 From: Geert Uytterhoeven To: Benjamin Herrenschmidt Date: Fri, 8 May 2009 16:01:11 +0200 Message-Id: <1241791284-11490-3-git-send-email-Geert.Uytterhoeven@sonycom.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1241791284-11490-2-git-send-email-Geert.Uytterhoeven@sonycom.com> References: <1241791284-11490-1-git-send-email-Geert.Uytterhoeven@sonycom.com> <1241791284-11490-2-git-send-email-Geert.Uytterhoeven@sonycom.com> Cc: Geert Uytterhoeven , linux-fbdev-devel@lists.sourceforge.net, cbe-oss-dev@ozlabs.org, Jim Paris , linux-kernel@vger.kernel.org Subject: [Cbe-oss-dev] [PATCH 02/15] ps3vram: Use proc_create_data() instead of proc_create() X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Use proc_create_data() to avoid race conditions. Reported-by: Alexey Dobriyan Signed-off-by: Geert Uytterhoeven Cc: Jim Paris --- 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)