scst: add mutex_lock/unlock around scst_alloc_add_acg()

The CONFIG_SCST_PROC build was calling scst_alloc_add_acg() without holding the
scst_mutex.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7155 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2017-04-29 01:00:59 +00:00
parent a9dcdfadee
commit 128d2b20a8

View File

@@ -2703,7 +2703,9 @@ static int __init init_scst(void)
goto out_sysfs_cleanup;
#ifdef CONFIG_SCST_PROC
mutex_lock(&scst_mutex);
res = scst_alloc_add_acg(NULL, SCST_DEFAULT_ACG_NAME, false, &scst_default_acg);
mutex_unlock(&scst_mutex);
if (res != 0)
goto out_destroy_sgv_pool;
#endif