aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-11 04:22:20 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:25 -0400
commit41bfcfd9ac0fbb59aaaa18e3ed5774e85b716de4 (patch)
tree5dd2df45aac4c5961070bd89f8a1c26b97c1b649 /drivers/firmware
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')
-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 8136d779ddc8..08b161798443 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -718,14 +718,27 @@ static int __init dcdrbu_init(void)
718 return -EIO; 718 return -EIO;
719 } 719 }
720 720
721 sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr); 721 rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr);
722 sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr); 722 if (rc)
723 sysfs_create_bin_file(&rbu_device->dev.kobj, 723 goto out_devreg;
724 rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr);
725 if (rc)
726 goto out_data;
727 rc = sysfs_create_bin_file(&rbu_device->dev.kobj,
724 &rbu_packet_size_attr); 728 &rbu_packet_size_attr);
729 if (rc)
730 goto out_imtype;
725 731
726 rbu_data.entry_created = 0; 732 rbu_data.entry_created = 0;
727 return rc; 733 return 0;
728 734
735out_imtype:
736 sysfs_remove_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr);
737out_data:
738 sysfs_remove_bin_file(&rbu_device->dev.kobj, &rbu_data_attr);
739out_devreg:
740 platform_device_unregister(rbu_device);
741 return rc;
729} 742}
730 743
731static __exit void dcdrbu_exit(void) 744static __exit void dcdrbu_exit(void)