aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware/dell_rbu.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-11 01:22:20 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 11:14:25 -0700
commit41bfcfd9ac0fbb59aaaa18e3ed5774e85b716de4 (patch)
tree5dd2df45aac4c5961070bd89f8a1c26b97c1b649 /drivers/firmware/dell_rbu.c
parentc636ebdb186bf37f98d3839f69293597723edb36 (diff)
[PATCH] firmware/dell_rbu: handle sysfs errors
Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/firmware/dell_rbu.c')
-rw-r--r--drivers/firmware/dell_rbu.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index 8136d779ddc..08b16179844 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)