|
@@ -629,13 +629,18 @@ static int __init memstick_init(void)
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
rc = bus_register(&memstick_bus_type);
|
|
rc = bus_register(&memstick_bus_type);
|
|
|
- if (!rc)
|
|
|
|
|
- rc = class_register(&memstick_host_class);
|
|
|
|
|
|
|
+ if (rc)
|
|
|
|
|
+ goto error_destroy_workqueue;
|
|
|
|
|
|
|
|
- if (!rc)
|
|
|
|
|
- return 0;
|
|
|
|
|
|
|
+ rc = class_register(&memstick_host_class);
|
|
|
|
|
+ if (rc)
|
|
|
|
|
+ goto error_bus_unregister;
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
|
|
|
|
|
|
|
+error_bus_unregister:
|
|
|
bus_unregister(&memstick_bus_type);
|
|
bus_unregister(&memstick_bus_type);
|
|
|
|
|
+error_destroy_workqueue:
|
|
|
destroy_workqueue(workqueue);
|
|
destroy_workqueue(workqueue);
|
|
|
|
|
|
|
|
return rc;
|
|
return rc;
|