From: Jeff Garzik Date: Wed, 11 Oct 2006 08:22:20 +0000 (-0700) Subject: [PATCH] firmware/dell_rbu: handle sysfs errors X-Git-Tag: v2.6.19-rc2~48 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41bfcfd9ac0fbb59aaaa18e3ed5774e85b716de4;p=linux-2.6 [PATCH] firmware/dell_rbu: handle sysfs errors Signed-off-by: Jeff Garzik Cc: Matt Domsch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c index 8136d779dd..08b1617984 100644 --- a/drivers/firmware/dell_rbu.c +++ b/drivers/firmware/dell_rbu.c @@ -718,14 +718,27 @@ static int __init dcdrbu_init(void) return -EIO; } - sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr); - sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr); - sysfs_create_bin_file(&rbu_device->dev.kobj, + rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr); + if (rc) + goto out_devreg; + rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr); + if (rc) + goto out_data; + rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_packet_size_attr); + if (rc) + goto out_imtype; rbu_data.entry_created = 0; - return rc; + return 0; +out_imtype: + sysfs_remove_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr); +out_data: + sysfs_remove_bin_file(&rbu_device->dev.kobj, &rbu_data_attr); +out_devreg: + platform_device_unregister(rbu_device); + return rc; } static __exit void dcdrbu_exit(void)