From: Jerome Marchand Date: Fri, 17 Dec 2010 16:03:15 +0000 (+0100) Subject: Staging: zram: make zram_read return a bio error if the device is not initialized X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1aa326640d1e91d32179310441fa3030c501d0f3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Jeff Moyer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c index 0ab931e9ee7e..01d6dd952581 100644 --- a/drivers/staging/zram/zram_drv.c +++ b/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; }