summaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi/iscsi_target_login.h
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2018-08-27 14:45:16 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2018-08-30 07:07:12 -0400
commit05a86e78ea9823ec25b3515db078dd8a76fc263c (patch)
tree47b7cd2caed9db4f3de6f98d6cc96cfac2229b98 /drivers/target/iscsi/iscsi_target_login.h
parent7915919bb94e12460c58e27c708472e6f85f6699 (diff)
downloadlinux-stable-05a86e78ea9823ec25b3515db078dd8a76fc263c.tar.gz
linux-stable-05a86e78ea9823ec25b3515db078dd8a76fc263c.tar.bz2
linux-stable-05a86e78ea9823ec25b3515db078dd8a76fc263c.zip
scsi: iscsi: target: Fix conn_ops double free
If iscsi_login_init_conn fails it can free conn_ops. __iscsi_target_login_thread will then call iscsi_target_login_sess_out which will also free it. This fixes the problem by organizing conn allocation/setup into parts that are needed through the life of the conn and parts that are only needed for the login. The free functions then release what was allocated in the alloc functions. With this patch we have: iscsit_alloc_conn/iscsit_free_conn - allocs/frees the conn we need for the entire life of the conn. iscsi_login_init_conn/iscsi_target_nego_release - allocs/frees the parts of the conn that are only needed during login. Signed-off-by: Mike Christie <mchristi@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_login.h')
-rw-r--r--drivers/target/iscsi/iscsi_target_login.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target_login.h b/drivers/target/iscsi/iscsi_target_login.h
index 74ac3abc44a0..3b8e3639ff5d 100644
--- a/drivers/target/iscsi/iscsi_target_login.h
+++ b/drivers/target/iscsi/iscsi_target_login.h
@@ -19,7 +19,7 @@ extern int iscsi_target_setup_login_socket(struct iscsi_np *,
extern int iscsit_accept_np(struct iscsi_np *, struct iscsi_conn *);
extern int iscsit_get_login_rx(struct iscsi_conn *, struct iscsi_login *);
extern int iscsit_put_login_tx(struct iscsi_conn *, struct iscsi_login *, u32);
-extern void iscsit_free_conn(struct iscsi_np *, struct iscsi_conn *);
+extern void iscsit_free_conn(struct iscsi_conn *);
extern int iscsit_start_kthreads(struct iscsi_conn *);
extern void iscsi_post_login_handler(struct iscsi_np *, struct iscsi_conn *, u8);
extern void iscsi_target_login_sess_out(struct iscsi_conn *, struct iscsi_np *,