sgv_pool_create(): Return NULL if sgv_pool_init() fails

The current implementation of sgv_pool_create() returns a dangling
pointer if pool allocation succeeds but sgv_pool_init() fails. Modify
sgv_pool_create() such that a NULL pointer is returned if that happens.
This was detected by Coverity.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4756 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2013-02-06 21:41:41 +00:00
parent 991158998d
commit cb39459fa8

View File

@@ -1670,6 +1670,7 @@ out_unlock:
out_free:
kfree(pool);
pool = NULL;
goto out_unlock;
}
EXPORT_SYMBOL_GPL(sgv_pool_create);