lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 27 Nov 2015 21:26:12 +0800
From:	Minfei Huang <mnfhuang@...il.com>
To:	axboe@...com, m@...rling.me, akinobu.mita@...il.com,
	rusty@...tcorp.com.au, keith.busch@...el.com, mcgrof@...e.com,
	krinkin.m.u@...il.com
Cc:	linux-kernel@...r.kernel.org, mhuang@...hat.com,
	Minfei Huang <mnfhuang@...il.com>
Subject: [PATCH 1/2] null_blk: Remove null block from list in error path

To make consistent of null block list, we should remove enqueued null
block from the list before freeing it.

Signed-off-by: Minfei Huang <mnfhuang@...il.com>
---
 drivers/block/null_blk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index ec99568..729ecd7 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -738,7 +738,7 @@ static int null_add_dev(void)
 		rv = nvm_register(nullb->q, nullb->disk_name,
 							&null_lnvm_dev_ops);
 		if (rv)
-			goto out_cleanup_blk_queue;
+			goto out_cleanup_blk_list;
 		goto done;
 	}
 
@@ -765,6 +765,10 @@ done:
 out_cleanup_lightnvm:
 	if (use_lightnvm)
 		nvm_unregister(nullb->disk_name);
+out_cleanup_blk_list:
+	mutex_lock(&lock);
+	list_del_init(&nullb->list);
+	mutex_unlock(&lock);
 out_cleanup_blk_queue:
 	blk_cleanup_queue(nullb->q);
 out_cleanup_tags:
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ