Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254382
b: refs/heads/master
c: 02839a8
h: refs/heads/master
v: v3
  • Loading branch information
Dave Jiang authored and Dan Williams committed Jul 3, 2011
1 parent 81e4f1a commit 2a79578
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca507b98e65f539e0b3866b6aa8efd76c13be285
refs/heads/master: 02839a8b51002d90e4b7c52bf37531834b063f71
20 changes: 5 additions & 15 deletions trunk/drivers/scsi/isci/probe_roms.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,14 @@ struct isci_orom *isci_request_oprom(struct pci_dev *pdev)
enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem_params,
struct isci_orom *orom, int scu_index)
{
int i;

/* check for valid inputs */
if (!(scu_index >= 0
&& scu_index < SCI_MAX_CONTROLLERS
&& oem_params != NULL))
if (scu_index < 0 || scu_index > SCI_MAX_CONTROLLERS ||
scu_index > orom->hdr.num_elements || !oem_params)
return -EINVAL;

for (i = 0; i < SCI_MAX_PHYS; i++) {
oem_params->sds1.phys[i].sas_address.low =
orom->ctrl[scu_index].phys[i].sas_address.low;
oem_params->sds1.phys[i].sas_address.high =
orom->ctrl[scu_index].phys[i].sas_address.high;
}

for (i = 0; i < SCI_MAX_PORTS; i++)
oem_params->sds1.ports[i].phy_mask =
orom->ctrl[scu_index].ports[i].phy_mask;
memcpy(oem_params,
&orom->ctrl[scu_index],
sizeof(struct scic_sds_oem_params));

return 0;
}
Expand Down

0 comments on commit 2a79578

Please sign in to comment.