]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme-core: do not pass empty queue_limits to blk_mq_alloc_queue()
authorMaurizio Lombardi <mlombard@redhat.com>
Fri, 20 Feb 2026 13:30:16 +0000 (14:30 +0100)
committerKeith Busch <kbusch@kernel.org>
Tue, 10 Mar 2026 15:20:29 +0000 (08:20 -0700)
In nvme_alloc_admin_tag_set(), an empty queue_limits struct is
currently allocated on the stack and passed by reference to
blk_mq_alloc_queue().

This is redundant because blk_mq_alloc_queue() already handles
a NULL limits pointer by internally substituting it with a default
empty queue_limits struct.
Remove the unnecessary local variable and pass a NULL value.

Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c

index 3bc0b9ea00ce464892ba95ac77658141e24f4001..6370aa35cc06dcb6be19d2e75c36aa318dfa04e6 100644 (file)
@@ -4834,7 +4834,6 @@ EXPORT_SYMBOL_GPL(nvme_complete_async_event);
 int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
                const struct blk_mq_ops *ops, unsigned int cmd_size)
 {
-       struct queue_limits lim = {};
        int ret;
 
        memset(set, 0, sizeof(*set));
@@ -4861,7 +4860,7 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
        if (ctrl->admin_q)
                blk_put_queue(ctrl->admin_q);
 
-       ctrl->admin_q = blk_mq_alloc_queue(set, &lim, NULL);
+       ctrl->admin_q = blk_mq_alloc_queue(set, NULL, NULL);
        if (IS_ERR(ctrl->admin_q)) {
                ret = PTR_ERR(ctrl->admin_q);
                goto out_free_tagset;