|
@@ -105,7 +105,8 @@ int i2o_driver_register(struct i2o_driver *drv)
|
|
|
osm_err("too many drivers registered, increase "
|
|
|
"max_drivers\n");
|
|
|
spin_unlock_irqrestore(&i2o_drivers_lock, flags);
|
|
|
- return -EFAULT;
|
|
|
+ rc = -EFAULT;
|
|
|
+ goto out;
|
|
|
}
|
|
|
|
|
|
drv->context = i;
|
|
@@ -124,11 +125,14 @@ int i2o_driver_register(struct i2o_driver *drv)
|
|
|
}
|
|
|
|
|
|
rc = driver_register(&drv->driver);
|
|
|
- if (rc) {
|
|
|
- if (drv->event) {
|
|
|
- destroy_workqueue(drv->event_queue);
|
|
|
- drv->event_queue = NULL;
|
|
|
- }
|
|
|
+ if (rc)
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ return 0;
|
|
|
+out:
|
|
|
+ if (drv->event_queue) {
|
|
|
+ destroy_workqueue(drv->event_queue);
|
|
|
+ drv->event_queue = NULL;
|
|
|
}
|
|
|
|
|
|
return rc;
|