]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/staging/zram/zram_drv.c
Staging: zram: work around oops due to startup ordering snafu
[~shefty/rdma-dev.git] / drivers / staging / zram / zram_drv.c
index c5f84ee3d28a9c4b425b2adfcbdc228351dafaa6..72f1b9ce577b3948ff7c669834b725d83e6bc889 100644 (file)
@@ -435,6 +435,12 @@ static int zram_make_request(struct request_queue *queue, struct bio *bio)
        int ret = 0;
        struct zram *zram = queue->queuedata;
 
+       if (unlikely(!zram->init_done)) {
+               set_bit(BIO_UPTODATE, &bio->bi_flags);
+               bio_endio(bio, 0);
+               return 0;
+       }
+
        if (!valid_io_request(zram, bio)) {
                zram_stat64_inc(zram, &zram->stats.invalid_io);
                bio_io_error(bio);