From: Linus Torvalds Date: Mon, 10 Jul 2006 11:45:01 +0000 (-0700) Subject: [PATCH] swsusp: fix panic when signature can't be read X-Git-Tag: v2.6.18-rc2~170 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aeceb15738958fe59cd9fe537f40317b1a3bc731;p=linux-2.6 [PATCH] swsusp: fix panic when signature can't be read Do not panic a machine when swsusp signature can't be read. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/power/swap.c b/kernel/power/swap.c index a57c661c7e..f1dd146bd6 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; }