[SCSI] iscsi_tcp: check for valid session before accessing
Check that the session is setup before accessing its connection. This fixes a oops where userspace tries to get the ip address before the session is bound to a host. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Родитель
9cb48e7b9e
Коммит
eee2b5c840
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче