projects/linux·commit aeceb157

[PATCH] swsusp: fix panic when signature can't be read

aeceb157 · Linus Torvalds <[email protected]> · 2006-07-10 04:45:01 -07:00

Do not panic a machine when swsusp signature can't be read.

Signed-off-by: Pavel Machek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
aeceb15738958fe59cd9fe537f40317b1a3bc731
Parents
712f403a

Changes

1 files changed · +4 −2

FileStatusAddDelContent
kernel/power/swap.cmodified+4−2View file

kernel/power/swap.c

View file
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index a57c661..f1dd146 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -311,8 +311,10 @@ static atomic_t io_done = ATOMIC_INIT(0);
static int end_io(struct bio *bio, unsigned int num, int err)
{
- if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
- panic("I/O error reading memory image");
+ if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) {
+ printk(KERN_ERR "I/O error reading swsusp image.\n");
+ return -EIO;
+ }
atomic_set(&io_done, 0);
return 0;
}