aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-03-08 15:06:13 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-12 19:31:50 -0400
commit9f35575dfc172f0a93fb464761883c8f49599b7a (patch)
tree5459681e96de3914a95c4993fc6f54b0e3b2ffee /include/linux
parent392ee1e6dd901db6c4504617476f6442ed91f72d (diff)
[PATCH] pci: Repair pci_save/restore_state so we can restore one save many times.
Because we do not reserve space for the pci-x and pci-e state in struct pci dev we need to dynamically allocate it. However because we need to support restore being called multiple times after a single save it is never safe to free the buffers we have allocated to hold the state. So this patch modifies the save routines to first check to see if we have already allocated a state buffer before allocating a new one. Then the restore routines are modified to not free the state after restoring it. Simple and it fixes some subtle error path handling bugs, that are hard to test for. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 78417e421b4c..481ea0663f19 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -209,11 +209,6 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev,
209 hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); 209 hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space);
210} 210}
211 211
212static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap)
213{
214 hlist_del(&cap->next);
215}
216
217/* 212/*
218 * For PCI devices, the region numbers are assigned this way: 213 * For PCI devices, the region numbers are assigned this way:
219 * 214 *