From patchwork Fri May 8 14:01:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 27003 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 6228FB6F44 for ; Sat, 9 May 2009 00:04:07 +1000 (EST) Received: by ozlabs.org (Postfix) id 2BF7BDE32A; Sat, 9 May 2009 00:02:34 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 29CE5DE322 for ; Sat, 9 May 2009 00:02:34 +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 34482DE00A for ; Sat, 9 May 2009 00:01:34 +1000 (EST) Received: from vixen.sonytel.be (piraat.sonytel.be [43.221.60.197]) by pophost.sonytel.be (Postfix) with ESMTP id A022444489; Fri, 8 May 2009 16:01:30 +0200 (CEST) Received: from geert by vixen.sonytel.be with local (Exim 4.63) (envelope-from ) id 1M2Qdm-00030X-O9; Fri, 08 May 2009 16:01:30 +0200 From: Geert Uytterhoeven To: Benjamin Herrenschmidt Date: Fri, 8 May 2009 16:01:16 +0200 Message-Id: <1241791284-11490-8-git-send-email-Geert.Uytterhoeven@sonycom.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1241791284-11490-7-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> <1241791284-11490-3-git-send-email-Geert.Uytterhoeven@sonycom.com> <1241791284-11490-4-git-send-email-Geert.Uytterhoeven@sonycom.com> <1241791284-11490-5-git-send-email-Geert.Uytterhoeven@sonycom.com> <1241791284-11490-6-git-send-email-Geert.Uytterhoeven@sonycom.com> <1241791284-11490-7-git-send-email-Geert.Uytterhoeven@sonycom.com> Cc: Geert Uytterhoeven , linux-fbdev-devel@lists.sourceforge.net, cbe-oss-dev@ozlabs.org, linux-kernel@vger.kernel.org Subject: [Cbe-oss-dev] [PATCH 07/15] ps3fb: Correct handling of device opening in ps3fb_probe() 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 - ps3_open_hv_device() returns a standard error value, - Add missing call to ps3_close_hv_device() in the error path. Signed-off-by: Geert Uytterhoeven --- drivers/video/ps3fb.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index a745018..542ffc3 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c @@ -985,7 +985,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) { struct fb_info *info; struct ps3fb_par *par; - int retval = -ENOMEM; + int retval; u64 ddr_lpar = 0; u64 lpar_dma_control = 0; u64 lpar_driver_info = 0; @@ -1003,8 +1003,8 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) return -ENOMEM; } - status = ps3_open_hv_device(dev); - if (status) { + retval = ps3_open_hv_device(dev); + if (retval) { dev_err(&dev->core, "%s: ps3_open_hv_device failed\n", __func__); goto err; @@ -1027,7 +1027,8 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " "%d\n", __func__, status); - goto err; + retval = -ENODEV; + goto err_close_device; } #endif #ifdef HEAD_B @@ -1040,7 +1041,8 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) "%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: " "%d\n", __func__, status); - goto err; + retval = -ENODEV; + goto err_close_device; } #endif @@ -1057,7 +1059,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) if (status) { dev_err(&dev->core, "%s: lv1_gpu_memory_allocate failed: %d\n", __func__, status); - goto err; + goto err_close_device; } dev_dbg(&dev->core, "ddr:lpar:0x%llx\n", ddr_lpar); @@ -1221,6 +1223,8 @@ err_gpu_context_free: lv1_gpu_context_free(ps3fb.context_handle); err_gpu_memory_free: lv1_gpu_memory_free(ps3fb.memory_handle); +err_close_device: + ps3_close_hv_device(dev); err: return retval; }