提交 868e9f19 编写于 作者: M Mike Christie 提交者: Jialin Zhang

scsi: iscsi: Move pool freeing

mainline inclusion
from mainline-v5.14-rc1
commit a1f3486b
category: bugfix
bugzilla: 188443, https://gitee.com/openeuler/kernel/issues/I6I8YD
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a1f3486b3b095ed2259d7a1fc021a8b6e72a5365

----------------------------------------

This doesn't fix any bugs, but it makes more sense to free the pool after
we have removed the session. At that time we know nothing is touching any
of the session fields, because all devices have been removed and scans are
stopped.

Link: https://lore.kernel.org/r/20210525181821.7617-19-michael.christie@oracle.comReviewed-by: NLee Duncan <lduncan@suse.com>
Signed-off-by: NMike Christie <michael.christie@oracle.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 cfc78156
...@@ -2993,10 +2993,9 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) ...@@ -2993,10 +2993,9 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
struct module *owner = cls_session->transport->owner; struct module *owner = cls_session->transport->owner;
struct Scsi_Host *shost = session->host; struct Scsi_Host *shost = session->host;
iscsi_pool_free(&session->cmdpool);
iscsi_remove_session(cls_session); iscsi_remove_session(cls_session);
iscsi_pool_free(&session->cmdpool);
kfree(session->password); kfree(session->password);
kfree(session->password_in); kfree(session->password_in);
kfree(session->username); kfree(session->username);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册