提交 6330a2d0 编写于 作者: J Josef Bacik 提交者: Jens Axboe

nbd: cleanup workqueue on error properly

If we fail to register the blockdev we need to make sure to destroy the
recv workqueue.
Signed-off-by: NJosef Bacik <jbacik@fb.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 e544541b
...@@ -1121,8 +1121,10 @@ static int __init nbd_init(void) ...@@ -1121,8 +1121,10 @@ static int __init nbd_init(void)
if (!recv_workqueue) if (!recv_workqueue)
return -ENOMEM; return -ENOMEM;
if (register_blkdev(NBD_MAJOR, "nbd")) if (register_blkdev(NBD_MAJOR, "nbd")) {
destroy_workqueue(recv_workqueue);
return -EIO; return -EIO;
}
nbd_dbg_init(); nbd_dbg_init();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册