We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c59789 commit 22c17e2Copy full SHA for 22c17e2
block/blk-mq.c
@@ -4045,9 +4045,14 @@ EXPORT_SYMBOL(__blk_mq_alloc_disk);
4045
struct gendisk *blk_mq_alloc_disk_for_queue(struct request_queue *q,
4046
struct lock_class_key *lkclass)
4047
{
4048
+ struct gendisk *disk;
4049
+
4050
if (!blk_get_queue(q))
4051
return NULL;
- return __alloc_disk_node(q, NUMA_NO_NODE, lkclass);
4052
+ disk = __alloc_disk_node(q, NUMA_NO_NODE, lkclass);
4053
+ if (!disk)
4054
+ blk_put_queue(q);
4055
+ return disk;
4056
}
4057
EXPORT_SYMBOL(blk_mq_alloc_disk_for_queue);
4058
0 commit comments