Commit 10992435 authored by Wei Yongjun's avatar Wei Yongjun Committed by Linus Torvalds

drivers/message/i2o/driver.c: add missing destroy_workqueue() on error in i2o_driver_register()

Add the missing destroy_workqueue() before return from
i2o_driver_register() in the error handling case.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ab767865
...@@ -105,7 +105,8 @@ int i2o_driver_register(struct i2o_driver *drv) ...@@ -105,7 +105,8 @@ int i2o_driver_register(struct i2o_driver *drv)
osm_err("too many drivers registered, increase " osm_err("too many drivers registered, increase "
"max_drivers\n"); "max_drivers\n");
spin_unlock_irqrestore(&i2o_drivers_lock, flags); spin_unlock_irqrestore(&i2o_drivers_lock, flags);
return -EFAULT; rc = -EFAULT;
goto out;
} }
drv->context = i; drv->context = i;
...@@ -124,11 +125,14 @@ int i2o_driver_register(struct i2o_driver *drv) ...@@ -124,11 +125,14 @@ int i2o_driver_register(struct i2o_driver *drv)
} }
rc = driver_register(&drv->driver); rc = driver_register(&drv->driver);
if (rc) { if (rc)
if (drv->event) { goto out;
destroy_workqueue(drv->event_queue);
drv->event_queue = NULL; return 0;
} out:
if (drv->event_queue) {
destroy_workqueue(drv->event_queue);
drv->event_queue = NULL;
} }
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment