Skip to content

Commit

Permalink
isci: fix isci_pci_probe() generates warning on efi failure path
Browse files Browse the repository at this point in the history
commit 6d70a74 upstream.

The oem parameter image embedded in the efi variable is at an offset
from the start of the variable.  However, in the failure path we try to
free the 'orom' pointer which is only valid when the paramaters are
being read from the legacy option-rom space.

Since failure to load the oem parameters is unlikely and we keep the
memory around in the success case just defer all de-allocation to devm.

Reported-by: Don Morris <don.morris@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Williams authored and Greg Kroah-Hartman committed Oct 7, 2012
1 parent 39d6594 commit efb238b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion drivers/scsi/isci/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
orom->hdr.version)) {
dev_warn(&pdev->dev,
"[%d]: invalid oem parameters detected, falling back to firmware\n", i);
devm_kfree(&pdev->dev, orom);
orom = NULL;
break;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/isci/probe_roms.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ struct isci_orom *isci_request_oprom(struct pci_dev *pdev)

if (i >= len) {
dev_err(&pdev->dev, "oprom parse error\n");
devm_kfree(&pdev->dev, rom);
rom = NULL;
}
pci_unmap_biosrom(oprom);
Expand Down

0 comments on commit efb238b

Please sign in to comment.