Merge tag 'soundwire-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul...
[linux-2.6-block.git] / block / blk-mq.c
index 32b8ad3d341b6dd2361978af56d0a34f2609011e..ce0f5f4ede70cdc55e102359601ff0149fc075e6 100644 (file)
@@ -2865,7 +2865,7 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
                goto err_exit;
 
        if (blk_mq_alloc_ctxs(q))
-               goto err_exit;
+               goto err_poll;
 
        /* init q->mq_kobj and sw queues' kobjects */
        blk_mq_sysfs_init(q);
@@ -2929,6 +2929,9 @@ err_hctxs:
        kfree(q->queue_hw_ctx);
 err_sys_init:
        blk_mq_sysfs_deinit(q);
+err_poll:
+       blk_stat_free_callback(q->poll_cb);
+       q->poll_cb = NULL;
 err_exit:
        q->mq_ops = NULL;
        return ERR_PTR(-ENOMEM);