isert: fix working with freed conn object

isert_delete_conn_dev function checks if it needs to close the connection
by checking that dev conn is not NULL.
We were missing set conn to null when freeing it and that caused working
with memory that was already freed.

Signed-off-by: Israel Rukshin <israelr@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Israel Rukshin
2016-08-17 07:28:38 +00:00
parent b292383396
commit 73b50bce1b
@@ -453,6 +453,7 @@ static void isert_dev_disconnect(struct iscsi_conn* iscsi_conn)
if (dev) {
isert_del_timer(dev);
dev->state = CS_DISCONNECTED;
dev->conn = NULL;
if (dev->login_req) {
isert_task_abort(dev->login_req);
spin_lock(&dev->pdu_lock);