]> err.no Git - linux-2.6/commitdiff
[PATCH] pcmcia/ds: driver layer error checking
authorRandy Dunlap <rdunlap@xenotime.net>
Fri, 20 Oct 2006 21:44:12 +0000 (14:44 -0700)
committerDominik Brodowski <linux@dominikbrodowski.net>
Thu, 26 Oct 2006 01:59:40 +0000 (21:59 -0400)
Check driver layer return values in pcmcia/ds.c

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
drivers/pcmcia/ds.c

index 74b3124e8247e444fd2911eecfe0de1ca5597063..af392bfee5a6e7d2573b029955c6849d53557eb9 100644 (file)
@@ -1292,10 +1292,22 @@ struct bus_type pcmcia_bus_type = {
 
 static int __init init_pcmcia_bus(void)
 {
+       int ret;
+
        spin_lock_init(&pcmcia_dev_list_lock);
 
-       bus_register(&pcmcia_bus_type);
-       class_interface_register(&pcmcia_bus_interface);
+       ret = bus_register(&pcmcia_bus_type);
+       if (ret < 0) {
+               printk(KERN_WARNING "pcmcia: bus_register error: %d\n", ret);
+               return ret;
+       }
+       ret = class_interface_register(&pcmcia_bus_interface);
+       if (ret < 0) {
+               printk(KERN_WARNING
+                       "pcmcia: class_interface_register error: %d\n", ret);
+               bus_unregister(&pcmcia_bus_type);
+               return ret;
+       }
 
        pcmcia_setup_ioctl();