riscv: Do not set initial_boot_params to the linear address of the dtb
[platform/kernel/linux-starfive.git] / block / blk-core.c
index 82b5b2c..9e5e027 100644 (file)
@@ -858,10 +858,16 @@ EXPORT_SYMBOL(submit_bio);
  */
 int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags)
 {
-       struct request_queue *q = bdev_get_queue(bio->bi_bdev);
        blk_qc_t cookie = READ_ONCE(bio->bi_cookie);
+       struct block_device *bdev;
+       struct request_queue *q;
        int ret = 0;
 
+       bdev = READ_ONCE(bio->bi_bdev);
+       if (!bdev)
+               return 0;
+
+       q = bdev_get_queue(bdev);
        if (cookie == BLK_QC_T_NONE ||
            !test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
                return 0;
@@ -930,7 +936,7 @@ int iocb_bio_iopoll(struct kiocb *kiocb, struct io_comp_batch *iob,
         */
        rcu_read_lock();
        bio = READ_ONCE(kiocb->private);
-       if (bio && bio->bi_bdev)
+       if (bio)
                ret = bio_poll(bio, iob, flags);
        rcu_read_unlock();