]> Pileus Git - ~andy/linux/commitdiff
isci: fix isci_pci_probe() generates warning on efi failure path
authorDan Williams <dan.j.williams@intel.com>
Fri, 22 Jun 2012 18:31:14 +0000 (11:31 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 3 Jul 2012 19:09:30 +0000 (12:09 -0700)
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.

Cc: <stable@vger.kernel.org>
Reported-by: Don Morris <don.morris@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/scsi/isci/init.c
drivers/scsi/isci/probe_roms.c

index 47e28b55502911c033df0a4c19e02a090b24b240..8870bd3b6383cb08c130431829aa926abeaca38d 100644 (file)
@@ -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;
                }
index 4d95654c3fd4852ebeaff740e11bbe2492d4c4a5..8ac646e5eddc9476603fb98c8ce5bd2a7b0be224 100644 (file)
@@ -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);