提交 e578e9a1 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

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: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b3762bfc
......@@ -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;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册