소스 검색

[SCSI] zfcp: prevent fc_remote_port_delete calls for unregistered rport

In case of an adapter reopen all rports have to be deleted from the
environment. This should only happen for already registered rports
otherwise fc_remote_port_delete is called with a NULL pointer.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Swen Schillig 16 년 전
부모
커밋
e4e9ba5d93
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      drivers/s390/scsi/zfcp_erp.c

+ 2 - 0
drivers/s390/scsi/zfcp_erp.c

@@ -1236,6 +1236,8 @@ static void zfcp_erp_rports_del(struct zfcp_adapter *adapter)
 {
 {
 	struct zfcp_port *port;
 	struct zfcp_port *port;
 	list_for_each_entry(port, &adapter->port_list_head, list) {
 	list_for_each_entry(port, &adapter->port_list_head, list) {
+		if (!port->rport)
+			continue;
 		fc_remote_port_delete(port->rport);
 		fc_remote_port_delete(port->rport);
 		port->rport = NULL;
 		port->rport = NULL;
 	}
 	}