lkml.org 
[lkml]   [2012]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/5] Fix an access-after-free issue in function pci_stop_and_remove_bus()
Date
If pci_stop_and_remove_bus() is called to remove a pci root bus,
the host_bridge structure may have already been freed after returning
from pci_remove_bus(), so don't access the structure any more.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
---
drivers/pci/remove.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 75b0092..25f368e 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -194,9 +194,6 @@ void pci_stop_and_remove_bus(struct pci_bus *bus)

pci_remove_bus(bus);

- if (host_bridge)
- host_bridge->bus = NULL;
-
if (pci_bridge)
pci_bridge->subordinate = NULL;
}
--
1.7.5.4


\
 
 \ /
  Last update: 2012-03-11 18:57    [W:0.051 / U:1.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site