소스 검색

[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 <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Linus Torvalds 19 년 전
부모
커밋
aeceb15738
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      kernel/power/swap.c

+ 4 - 2
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)
 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);
 	atomic_set(&io_done, 0);
 	return 0;
 	return 0;
 }
 }