diff options
-rw-r--r-- | drivers/block/null_blk.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index a428e4ef71fd..09e3c0d87ecc 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c | |||
@@ -232,20 +232,19 @@ static void end_cmd(struct nullb_cmd *cmd) | |||
232 | break; | 232 | break; |
233 | case NULL_Q_BIO: | 233 | case NULL_Q_BIO: |
234 | bio_endio(cmd->bio); | 234 | bio_endio(cmd->bio); |
235 | goto free_cmd; | 235 | break; |
236 | } | 236 | } |
237 | 237 | ||
238 | free_cmd(cmd); | ||
239 | |||
238 | /* Restart queue if needed, as we are freeing a tag */ | 240 | /* Restart queue if needed, as we are freeing a tag */ |
239 | if (q && !q->mq_ops && blk_queue_stopped(q)) { | 241 | if (queue_mode == NULL_Q_RQ && blk_queue_stopped(q)) { |
240 | unsigned long flags; | 242 | unsigned long flags; |
241 | 243 | ||
242 | spin_lock_irqsave(q->queue_lock, flags); | 244 | spin_lock_irqsave(q->queue_lock, flags); |
243 | if (blk_queue_stopped(q)) | 245 | blk_start_queue_async(q); |
244 | blk_start_queue(q); | ||
245 | spin_unlock_irqrestore(q->queue_lock, flags); | 246 | spin_unlock_irqrestore(q->queue_lock, flags); |
246 | } | 247 | } |
247 | free_cmd: | ||
248 | free_cmd(cmd); | ||
249 | } | 248 | } |
250 | 249 | ||
251 | static enum hrtimer_restart null_cmd_timer_expired(struct hrtimer *timer) | 250 | static enum hrtimer_restart null_cmd_timer_expired(struct hrtimer *timer) |