summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2007-05-24 00:58:05 +0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-24 07:14:14 +0400
commite578e9a1cc8a5983d87126d5877e305d3189f1b9 (patch)
treef4e2903bc010ac88a392dd714cb9986cbfaa4c12
parentb3762bfc8d046342db664d855f8f875e8a4c2ca1 (diff)
downloadlinux-e578e9a1cc8a5983d87126d5877e305d3189f1b9.tar.xz
i2o: destroy event queue only when drv->event is set
i2o_driver_register() initalizes event queue for driver only when drv->event is set. So similarly the event queue should be destroyed only when drv->event is set in the error path. Otherwise destroy_workqueue() will called with NULL. Cc: Markus Lidel <Markus.Lidel@shadowconnect.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/message/i2o/driver.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c
index d3235f213c89..d330e4eb86ac 100644
--- a/drivers/message/i2o/driver.c
+++ b/drivers/message/i2o/driver.c
@@ -123,8 +123,12 @@ int i2o_driver_register(struct i2o_driver *drv)
}
rc = driver_register(&drv->driver);
- if (rc)
- destroy_workqueue(drv->event_queue);
+ if (rc) {
+ if (drv->event) {
+ destroy_workqueue(drv->event_queue);
+ drv->event_queue = NULL;
+ }
+ }
return rc;
};