Skip to content

Commit

Permalink
Merge pull request #194 from truenas/NAS-131381_ee
Browse files Browse the repository at this point in the history
Revert "scsi: mpi3mr: Sanitise num_phys"
  • Loading branch information
amotin authored Sep 26, 2024
2 parents ff6360d + 4eb9b8c commit 5259e91
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions drivers/scsi/mpi3mr/mpi3mr_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1355,21 +1355,11 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc,
mpi3mr_sas_port_sanity_check(mrioc, mr_sas_node,
mr_sas_port->remote_identify.sas_address, hba_port);

if (mr_sas_node->num_phys > sizeof(mr_sas_port->phy_mask) * 8)
ioc_info(mrioc, "max port count %u could be too high\n",
mr_sas_node->num_phys);

for (i = 0; i < mr_sas_node->num_phys; i++) {
if ((mr_sas_node->phy[i].remote_identify.sas_address !=
mr_sas_port->remote_identify.sas_address) ||
(mr_sas_node->phy[i].hba_port != hba_port))
continue;

if (i > sizeof(mr_sas_port->phy_mask) * 8) {
ioc_warn(mrioc, "skipping port %u, max allowed value is %zu\n",
i, sizeof(mr_sas_port->phy_mask) * 8);
goto out_fail;
}
list_add_tail(&mr_sas_node->phy[i].port_siblings,
&mr_sas_port->phy_list);
mr_sas_port->num_phys++;
Expand Down

0 comments on commit 5259e91

Please sign in to comment.