提交 6bc6204e 编写于 作者: K Krishna Gudipati 提交者: James Bottomley

[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: NKrishna Gudipati <kgudipat@brocade.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 f1633011
......@@ -2647,7 +2647,8 @@ 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);
rp = rp_fcs->bfa_rport;
if (rp_fcs)
rp = rp_fcs->bfa_rport;
}
lunm_list = bfa_get_lun_mask_list(bfa);
......@@ -2715,7 +2716,8 @@ 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);
rp = rp_fcs->bfa_rport;
if (rp_fcs)
rp = rp_fcs->bfa_rport;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册