mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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: Josef Bacik <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
e544541b07
commit
6330a2d0b4
1 changed files with 3 additions and 1 deletions
|
|
@ -1121,8 +1121,10 @@ static int __init nbd_init(void)
|
|||
if (!recv_workqueue)
|
||||
return -ENOMEM;
|
||||
|
||||
if (register_blkdev(NBD_MAJOR, "nbd"))
|
||||
if (register_blkdev(NBD_MAJOR, "nbd")) {
|
||||
destroy_workqueue(recv_workqueue);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
nbd_dbg_init();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue