Thread (4 messages) 4 messages, 3 authors, 2008-11-11
STALE6531d

[PATCH] drivers: process failure of sysfs_create_group()

From: Jianjun Kong <hidden>
Date: 2008-11-10 10:53:25
Also in: lkml
Subsystem: framebuffer layer, the rest · Maintainers: Helge Deller, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help