diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-12-17 12:19:53 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-23 09:07:26 +0100 |
commit | 88bfdab618dffd22db9b0cf29a913231bf67e1e3 (patch) | |
tree | a8aec6726ef47a4002fb49dffb81a53793447fda /drivers | |
parent | 82f39f0219441075bdba1aa3e14b5d4b1fa0b481 (diff) | |
download | linux-stable-88bfdab618dffd22db9b0cf29a913231bf67e1e3.tar.gz linux-stable-88bfdab618dffd22db9b0cf29a913231bf67e1e3.tar.bz2 linux-stable-88bfdab618dffd22db9b0cf29a913231bf67e1e3.zip |
scsi: target/core: Use kmem_cache_free() instead of kfree()
commit 8b2db98e814a5ec45e8800fc22ca9000ae0a517b upstream.
memory allocated by kmem_cache_alloc() should be freed using
kmem_cache_free(), not kfree().
Fixes: ad669505c4e9 ("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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/target/target_core_transport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 3f7aad45d215..f1b730b77a31 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -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; |