https://github.com/torvalds/linux
Revision 9f35575dfc172f0a93fb464761883c8f49599b7a authored by Eric W. Biederman on 08 March 2007, 20:06:13 UTC, committed by Linus Torvalds on 12 March 2007, 23:31:50 UTC
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>
1 parent 392ee1e
History
Tip revision: 9f35575dfc172f0a93fb464761883c8f49599b7a authored by Eric W. Biederman on 08 March 2007, 20:06:13 UTC
[PATCH] pci: Repair pci_save/restore_state so we can restore one save many times.
Tip revision: 9f35575
File Mode Size
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
scripts
security
sound
usr
.gitignore -rw-r--r-- 572 bytes
.mailmap -rw-r--r-- 3.5 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 88.9 KB
Kbuild -rw-r--r-- 1.2 KB
MAINTAINERS -rw-r--r-- 81.9 KB
Makefile -rw-r--r-- 49.1 KB
README -rw-r--r-- 16.5 KB
REPORTING-BUGS -rw-r--r-- 3.0 KB

README

back to top