clk: rockchip: make clk_half_divider_ops static
[linux-2.6-microblaze.git] / block / blk-flush.c
index aedd932..1eec9cb 100644 (file)
@@ -214,6 +214,16 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)
 
        /* release the tag's ownership to the req cloned from */
        spin_lock_irqsave(&fq->mq_flush_lock, flags);
+
+       if (!refcount_dec_and_test(&flush_rq->ref)) {
+               fq->rq_status = error;
+               spin_unlock_irqrestore(&fq->mq_flush_lock, flags);
+               return;
+       }
+
+       if (fq->rq_status != BLK_STS_OK)
+               error = fq->rq_status;
+
        hctx = flush_rq->mq_hctx;
        if (!q->elevator) {
                blk_mq_tag_set_rq(hctx, flush_rq->tag, fq->orig_rq);