Skip to content

Commit 8b2db98

Browse files
Wei Yongjunmartinkpetersen
authored andcommitted
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: ad66950 ("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>
1 parent c29d7d1 commit 8b2db98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/target/target_core_transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ struct se_session *transport_alloc_session(enum target_prot_op sup_prot_ops)
266266
}
267267
ret = transport_init_session(se_sess);
268268
if (ret < 0) {
269-
kfree(se_sess);
269+
kmem_cache_free(se_sess_cache, se_sess);
270270
return ERR_PTR(ret);
271271
}
272272
se_sess->sup_prot_ops = sup_prot_ops;

0 commit comments

Comments
 (0)