]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvme-pci: do not set the NUMA node of device if it has none
authorPratyush Yadav <ptyadav@amazon.de>
Tue, 12 Sep 2023 15:52:49 +0000 (17:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 11:18:19 +0000 (13:18 +0200)
[ Upstream commit dad651b2a44eb6b201738f810254279dca29d30d ]

If a device has no NUMA node information associated with it, the driver
puts the device in node first_memory_node (say node 0). Not having a
NUMA node and being associated with node 0 are completely different
things and it makes little sense to mix the two.

Signed-off-by: Pratyush Yadav <ptyadav@amazon.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/pci.c

index 0779bf237826437d701632d214dc5d311fdf4a9f..e5980df2094adb680cf0beed0e200a90a1ce295a 100644 (file)
@@ -2975,9 +2975,6 @@ static struct nvme_dev *nvme_pci_alloc_dev(struct pci_dev *pdev,
        struct nvme_dev *dev;
        int ret = -ENOMEM;
 
-       if (node == NUMA_NO_NODE)
-               set_dev_node(&pdev->dev, first_memory_node);
-
        dev = kzalloc_node(sizeof(*dev), GFP_KERNEL, node);
        if (!dev)
                return NULL;