]> git.hungrycats.org Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Oct 2012 15:32:29 +0000 (08:32 -0700)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/isci/init.c
drivers/scsi/isci/probe_roms.c

index bc6cf8886312244c7c15b3a9241b6f6dd0386136..4c150dffb1abf8f38774a656d5f0e3ccc8f76533 100644 (file)
@@ -481,7 +481,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 9b8117b9d7569e7a8bda7623ec2aa3a07fcfffb6..4c66f4682fd480ceceb221ca037e3cb5bcc07d49 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);