Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d42b6b46 authored by Jingoo Han's avatar Jingoo Han Committed by Sasha Levin
Browse files

of/address: use atomic allocation in pci_register_io_range()



[ Upstream commit 294240ffe784e951dc2ef070da04fa31ef6db3a0 ]

When kzalloc() is called under spin_lock(), GFP_ATOMIC should be
used to avoid sleeping allocation.
The call tree is:
  of_pci_range_to_resource()
    --> pci_register_io_range() <-- takes spin_lock(&io_range_lock);
       --> kzalloc()

Signed-off-by: default avatarJingoo Han <jingoohan1@gmail.com>
Cc: stable@vger.kernel.org # 3.18+
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent b396bdb5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -712,7 +712,7 @@ int __weak pci_register_io_range(phys_addr_t addr, resource_size_t size)
	}

	/* add the range to the list */
	range = kzalloc(sizeof(*range), GFP_KERNEL);
	range = kzalloc(sizeof(*range), GFP_ATOMIC);
	if (!range) {
		err = -ENOMEM;
		goto end_register;