diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 12b351213c59079acca9733e5b3116867839b33c..bfb6d07d87f06c8c9d1632fe27ef6907b4c46af7 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -759,6 +759,9 @@ static int iscsi_sw_tcp_host_get_param(struct Scsi_Host *shost, switch (param) { case ISCSI_HOST_PARAM_IPADDRESS: + if (!session) + return -ENOTCONN; + spin_lock_bh(&session->frwd_lock); conn = session->leadconn; if (!conn) {