mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
scsi: target/core: Use kmem_cache_free() instead of kfree()
commit8b2db98e81upstream. memory allocated by kmem_cache_alloc() should be freed using kmem_cache_free(), not kfree(). Fixes:ad669505c4("scsi: target/core: Make sure that target_wait_for_sess_cmds() waits long enough") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
82f39f0219
commit
88bfdab618
@@ -266,7 +266,7 @@ struct se_session *transport_alloc_session(enum target_prot_op sup_prot_ops)
|
||||
}
|
||||
ret = transport_init_session(se_sess);
|
||||
if (ret < 0) {
|
||||
kfree(se_sess);
|
||||
kmem_cache_free(se_sess_cache, se_sess);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
se_sess->sup_prot_ops = sup_prot_ops;
|
||||
|
||||
Reference in New Issue
Block a user