aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-11-12 18:10:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 22:09:26 -0500
commit10992435b30eb470e6b91d2415abfb79680d00b6 (patch)
treeb3998144abefadce0bfd6d57d284affc1bf229e1 /drivers/message
parentab76786561e0fa1c6d45d6963ab87bb6d628d4cb (diff)
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/i2o/driver.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c
index b6b92d760510..1b18a0d1d05b 100644
--- a/drivers/message/i2o/driver.c
+++ b/drivers/message/i2o/driver.c
@@ -105,7 +105,8 @@ int i2o_driver_register(struct i2o_driver *drv)
105 osm_err("too many drivers registered, increase " 105 osm_err("too many drivers registered, increase "
106 "max_drivers\n"); 106 "max_drivers\n");
107 spin_unlock_irqrestore(&i2o_drivers_lock, flags); 107 spin_unlock_irqrestore(&i2o_drivers_lock, flags);
108 return -EFAULT; 108 rc = -EFAULT;
109 goto out;
109 } 110 }
110 111
111 drv->context = i; 112 drv->context = i;
@@ -124,11 +125,14 @@ int i2o_driver_register(struct i2o_driver *drv)
124 } 125 }
125 126
126 rc = driver_register(&drv->driver); 127 rc = driver_register(&drv->driver);
127 if (rc) { 128 if (rc)
128 if (drv->event) { 129 goto out;
129 destroy_workqueue(drv->event_queue); 130
130 drv->event_queue = NULL; 131 return 0;
131 } 132out:
133 if (drv->event_queue) {
134 destroy_workqueue(drv->event_queue);
135 drv->event_queue = NULL;
132 } 136 }
133 137
134 return rc; 138 return rc;