Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754888AbYKJKxZ (ORCPT ); Mon, 10 Nov 2008 05:53:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754003AbYKJKxR (ORCPT ); Mon, 10 Nov 2008 05:53:17 -0500 Received: from smtp.zeuux.org ([210.51.160.52]:52774 "EHLO z.billxu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbYKJKxQ (ORCPT ); Mon, 10 Nov 2008 05:53:16 -0500 Date: Mon, 10 Nov 2008 18:53:32 +0800 From: Jianjun Kong To: spock@gentoo.org Cc: Linux-Kernel-Mailing-List , linux-fbdev-devel@lists.sourceforge.net Subject: [PATCH] drivers: process failure of sysfs_create_group() Message-ID: <20081110105332.GA19358@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1165 Lines: 40 drivers: drivers/video/uvesafb.c: When fail to call sysfs_create_group(), it should recycle resources and return the error. This patch fix for processing failure of sysfs_create_group(). Signed-off-by: Jianjun Kong --- drivers/video/uvesafb.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index 6c2d37f..a78d4d9 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -1811,12 +1811,16 @@ static int __devinit uvesafb_probe(struct platform_device *dev) info->fix.id); err = sysfs_create_group(&dev->dev.kobj, &uvesafb_dev_attgrp); - if (err != 0) + if (err != 0) { printk(KERN_WARNING "fb%d: failed to register attributes\n", info->node); + goto out_frame; + } return 0; +our_frame: + unregister_framebuffer(info); out_reg: release_region(0x3c0, 32); out_unmap: -- 1.5.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/