mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] firmware/dell_rbu: handle sysfs errors
@ 2006-10-10  6:56 Jeff Garzik
  0 siblings, 0 replies; only message in thread
From: Jeff Garzik @ 2006-10-10  6:56 UTC (permalink / raw)
  To: abhay_salunke, Andrew Morton, LKML



Signed-off-by: Jeff Garzik <jeff@garzik.org>

---

 drivers/firmware/dell_rbu.c |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

3ee9d835887cc49e747f3b39e7d8623918457e3d
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index fc17599..4fb5d72 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-10  6:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-10  6:56 [PATCH] firmware/dell_rbu: handle sysfs errors Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®