I was calling it in del_mtd_blktrans_dev, but ->request_fn could
still be running at that point, thus defer this call
to blktrans_dev_release
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
                container_of(kref, struct mtd_blktrans_dev, ref);
 
        dev->disk->private_data = NULL;
+       blk_cleanup_queue(dev->rq);
        put_disk(dev->disk);
        list_del(&dev->list);
        kfree(dev);
        old->rq->queuedata = NULL;
        blk_start_queue(old->rq);
        spin_unlock_irqrestore(&old->queue_lock, flags);
-       blk_cleanup_queue(old->rq);
 
        /* Ask trans driver for release to the mtd device */
        mutex_lock(&old->lock);