[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190221125252.390491719@linuxfoundation.org>
Date: Thu, 21 Feb 2019 15:36:13 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Wei Yongjun <weiyongjun1@...wei.com>,
Bart Van Assche <bvanassche@....org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 4.20 25/32] scsi: target/core: Use kmem_cache_free() instead of kfree()
4.20-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 8b2db98e814a5ec45e8800fc22ca9000ae0a517b ]
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@...wei.com>
Reviewed-by: Bart Van Assche <bvanassche@....org>
Signed-off-by: Martin K. Petersen <martin.petersen@...cle.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/target/target_core_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index ffa5b9f771b57..900442605c72f 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;
--
2.19.1
Powered by blists - more mailing lists