Skip to content

Commit

Permalink
core/pci: Fix mem-leak on fast-reboot
Browse files Browse the repository at this point in the history
Fast-reboot has a memory leak which causes the system to crash after about
250 fast-reboots. The patch fixes the memory leak.
The cause of the leak was the pci_device's being freed, without freeing
the pci_slot within it.

Signed-off-by: Matt Brown <matthew.brown.dev@gmail.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
m-brow authored and stewartsmith committed Jul 20, 2017
1 parent 0b134f5 commit 57f2e78
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/pci.c
Expand Up @@ -1641,6 +1641,7 @@ static void __pci_reset(struct list_head *list)
while ((pd = list_pop(list, struct pci_device, link)) != NULL) {
__pci_reset(&pd->children);
dt_free(pd->dn);
free(pd->slot);
free(pd);
}
}
Expand Down

0 comments on commit 57f2e78

Please sign in to comment.