]> git.karo-electronics.de Git - karo-tx-linux.git/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)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 17 Oct 2012 02:34:07 +0000 (03:34 +0100)
commit 6d70a74ffd616073a68ae0974d98819bfa8e6da6 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: Ben Hutchings <ben@decadent.org.uk>
drivers/scsi/isci/init.c
drivers/scsi/isci/probe_roms.c

index 83d08b6e786fd500ed6b6b28952c245d317ab9b9..5c8b0dc5c0c865ab71bac9f5a5fa50085211b0c1 100644 (file)
@@ -469,7 +469,6 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
                if (sci_oem_parameters_validate(&orom->ctrl[i])) {
                        dev_warn(&pdev->dev,
                                 "[%d]: invalid oem parameters detected, falling back to firmware\n", i);
-                       devm_kfree(&pdev->dev, orom);
                        orom = NULL;
                        break;
                }
index b5f4341de2434ead30763b4228e49ff5ee2edc67..7cd637d501a8e5e0414af3abed4ca517eccac1e1 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);