Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6bc6204e authored by Krishna Gudipati's avatar Krishna Gudipati Committed by James Bottomley
Browse files

[SCSI] bfa: Fix possible NULL pointer dereference in lunmask add/delete.



Patch fixes the possible NULL pointer dereference when we try to add or delete
a rpwwn to the lunmask config which is not zoned to this port.  Check if the
FCS rport is not NULL before de-referencing it.

Signed-off-by: default avatarKrishna Gudipati <kgudipat@brocade.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent f1633011
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2647,6 +2647,7 @@ bfa_fcpim_lunmask_add(struct bfa_s *bfa, u16 vf_id, wwn_t *pwwn,
	if (port) {
		*pwwn = port->port_cfg.pwwn;
		rp_fcs = bfa_fcs_lport_get_rport_by_pwwn(port, rpwwn);
		if (rp_fcs)
			rp = rp_fcs->bfa_rport;
	}

@@ -2715,6 +2716,7 @@ bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id, wwn_t *pwwn,
		if (port) {
			*pwwn = port->port_cfg.pwwn;
			rp_fcs = bfa_fcs_lport_get_rport_by_pwwn(port, rpwwn);
			if (rp_fcs)
				rp = rp_fcs->bfa_rport;
		}
	}