Linux block layer
 help / color / mirror / Atom feed
* [PATCH] nbd: cleanup workqueue on error properly
@ 2017-02-15 21:49 Josef Bacik
  0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2017-02-15 21:49 UTC (permalink / raw)
  To: axboe, nbd-general, linux-block, kernel-team

If we fail to register the blockdev we need to make sure to destroy the
recv workqueue.

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 drivers/block/nbd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 0623f8f..a032a00 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1271,8 +1271,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();
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-15 21:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15 21:49 [PATCH] nbd: cleanup workqueue on error properly Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox