]> git.hungrycats.org Git - linux/commitdiff
[PATCH] PCI: fix hotplug double free
authorAlexander Nyberg <alexn@dsv.su.se>
Sat, 12 Mar 2005 13:43:53 +0000 (05:43 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 12 Mar 2005 13:43:53 +0000 (05:43 -0800)
[PATCH] PCI: fix hotplug double free

With the brackets missed out func could be freed twice.

Found by Coverity tool

Signed-off-by: Alexander Nyberg <alexn@dsv.su.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/pciehp_ctrl.c

index 279f53d78608d057dfed17bc451270dc8212eb8e..0dbcf04aa35e4683a94f5d0779027a44aa4fb9a1 100644 (file)
@@ -1354,10 +1354,11 @@ static u32 remove_board(struct pci_func *func, struct controller *ctrl)
                                dbg("PCI Bridge Hot-Remove s:b:d:f(%02x:%02x:%02x:%02x)\n", 
                                        ctrl->seg, func->bus, func->device, func->function);
                                bridge_slot_remove(func);
-                       } else
+                       } else {
                                dbg("PCI Function Hot-Remove s:b:d:f(%02x:%02x:%02x:%02x)\n", 
                                        ctrl->seg, func->bus, func->device, func->function);
                                slot_remove(func);
+                       }
 
                        func = pciehp_slot_find(ctrl->slot_bus, device, 0);
                }