From: Ye Bin yebin10@huawei.com
hulk inclusion category: bugfix bugzilla: NA CVE: NA
-----------------------------------------------
Now we wrapper iscsi_cls_session wtih iscsi_cls_session_warpper, so we alloc iscsi_cls_session_wrapper instead of iscsi_cls_session.
Signed-off-by: Ye Bin yebin10@huawei.com Reviewed-by: Jason Yan yanaijie@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/scsi/scsi_transport_iscsi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 20e69052161e6..d3632547799c9 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -1705,12 +1705,14 @@ EXPORT_SYMBOL_GPL(iscsi_is_session_online); static void iscsi_session_release(struct device *dev) { struct iscsi_cls_session *session = iscsi_dev_to_session(dev); + struct iscsi_cls_session_wrapper *session_wrapper = + iscsi_cls_session_to_wrapper(session); struct Scsi_Host *shost;
shost = iscsi_session_to_shost(session); scsi_host_put(shost); ISCSI_DBG_TRANS_SESSION(session, "Completing session release\n"); - kfree(session); + kfree(session_wrapper); }
int iscsi_is_session_dev(const struct device *dev) @@ -2014,13 +2016,14 @@ struct iscsi_cls_session * iscsi_alloc_session(struct Scsi_Host *shost, struct iscsi_transport *transport, int dd_size) { + struct iscsi_cls_session_wrapper *session_wrapper; struct iscsi_cls_session *session;
- session = kzalloc(sizeof(*session) + dd_size, - GFP_KERNEL); - if (!session) + session_wrapper = kzalloc(sizeof(*session_wrapper) + dd_size, + GFP_KERNEL); + if (!session_wrapper) return NULL; - + session = &session_wrapper->cls_sess; session->transport = transport; session->creator = -1; session->recovery_tmo = 120;