Commit 8b2db98e authored by Wei Yongjun's avatar Wei Yongjun Committed by Martin K. Petersen

scsi: target/core: Use kmem_cache_free() instead of kfree()

memory allocated by kmem_cache_alloc() should be freed using
kmem_cache_free(), not kfree().

Fixes: ad669505 ("scsi: target/core: Make sure that target_wait_for_sess_cmds() waits long enough")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c29d7d10
...@@ -266,7 +266,7 @@ struct se_session *transport_alloc_session(enum target_prot_op sup_prot_ops) ...@@ -266,7 +266,7 @@ struct se_session *transport_alloc_session(enum target_prot_op sup_prot_ops)
} }
ret = transport_init_session(se_sess); ret = transport_init_session(se_sess);
if (ret < 0) { if (ret < 0) {
kfree(se_sess); kmem_cache_free(se_sess_cache, se_sess);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
se_sess->sup_prot_ops = sup_prot_ops; se_sess->sup_prot_ops = sup_prot_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment