[PATCH] swsusp: fix panic when signature can't be read
authorLinus Torvalds <torvalds@osdl.org>
Mon, 10 Jul 2006 11:45:01 +0000 (04:45 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Jul 2006 20:24:22 +0000 (13:24 -0700)
Do not panic a machine when swsusp signature can't be read.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/power/swap.c

index a57c661..f1dd146 100644 (file)
@@ -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;
 }