From: Randy Dunlap Date: Fri, 20 Oct 2006 21:44:12 +0000 (-0700) Subject: [PATCH] pcmcia/ds: driver layer error checking X-Git-Tag: v2.6.19-rc4~24^2~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ace7d4772cf056d9b13b51bd496a8be968774592;p=linux-2.6 [PATCH] pcmcia/ds: driver layer error checking Check driver layer return values in pcmcia/ds.c Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Dominik Brodowski --- diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 74b3124e82..af392bfee5 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -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();