From 463ec0ac871f03e21674b446dc97d4def9b07bbf Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 15 Mar 2005 22:53:31 +0000 Subject: [PATCH] If bus_generic_susped returns an error, devlist is not freed. Free it. Submitted by: Ted Unangst (using the Coverity Prevent analysis tool) --- sys/dev/pci/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 172134763c1a..445b32b6a1d4 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1059,8 +1059,10 @@ pci_suspend(device_t dev) /* Suspend devices before potentially powering them down. */ error = bus_generic_suspend(dev); - if (error) + if (error) { + free(devlist, M_TEMP); return (error); + } /* * Always set the device to D3. If ACPI suggests a different