Преглед изворни кода

Staging: zram: make zram_read return a bio error if the device is not initialized

Make zram_read() return a bio error if the device is not initialized
instead of pretending nothing happened.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jerome Marchand пре 14 година
родитељ
комит
1aa326640d
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1 2
      drivers/staging/zram/zram_drv.c

+ 1 - 2
drivers/staging/zram/zram_drv.c

@@ -208,8 +208,7 @@ static int zram_read(struct zram *zram, struct bio *bio)
 	struct bio_vec *bvec;
 
 	if (unlikely(!zram->init_done)) {
-		set_bit(BIO_UPTODATE, &bio->bi_flags);
-		bio_endio(bio, 0);
+		bio_endio(bio, -ENXIO);
 		return 0;
 	}