mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
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:
@@ -1670,6 +1670,7 @@ out_unlock:
|
||||
|
||||
out_free:
|
||||
kfree(pool);
|
||||
pool = NULL;
|
||||
goto out_unlock;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sgv_pool_create);
|
||||
|
||||
Reference in New Issue
Block a user