of/address: use atomic allocation in pci_register_io_range()
Subsystems (2)
PATCH 1/1 of/address: use atomic allocation in pci_register_io_range()
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 Jingoo Han <[email protected]>
--- drivers/of/address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/address.c +1 -1
@@ -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;
Signature · 1 line
1.9.1
Rob Herring
AppliedQuoted 8 lines · Jingoo Han
When
kzalloc()is called underspin_lock(),GFP_ATOMICshould 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 Jingoo Han <[email protected]>
Applied. Thanks.
Rob
Quoted 21 lines
--- drivers/of/address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/of/address.c +1
-2@@ -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; --1.9.1