aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2015-12-04 08:53:42 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-04 11:19:55 -0500
commit84ed91526f9881886d70a082032236edaa20e7d4 (patch)
tree8a2a1d9a4f4fe7cf6991de5f31fc03612dea24c0
parent5377adb092664d336ac212499961cac5e8728794 (diff)
xhci: Fix memory leak in xhci_pme_acpi_rtd3_enable()
There is a memory leak because acpi_evaluate_dsm() actually returns an object which the caller is supposed to release. Fix this by calling ACPI_FREE() for the returned object (this expands to kfree() so passing NULL there is fine as well). While there correct indentation in !CONFIG_ACPI case. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: stable <stable@vger.kernel.org> # v4.2 Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci-pci.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 17f6897acde2..c62109091d12 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -188,10 +188,14 @@ static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev)
188 0xb7, 0x0c, 0x34, 0xac, 0x01, 0xe9, 0xbf, 0x45, 188 0xb7, 0x0c, 0x34, 0xac, 0x01, 0xe9, 0xbf, 0x45,
189 0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23, 189 0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23,
190 }; 190 };
191 acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1, NULL); 191 union acpi_object *obj;
192
193 obj = acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1,
194 NULL);
195 ACPI_FREE(obj);
192} 196}
193#else 197#else
194 static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } 198static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
195#endif /* CONFIG_ACPI */ 199#endif /* CONFIG_ACPI */
196 200
197/* called during probe() after chip reset completes */ 201/* called during probe() after chip reset completes */