Commit a35b0d6c authored by Jingoo Han's avatar Jingoo Han Committed by Greg Kroah-Hartman

of/address: use atomic allocation in pci_register_io_range()

commit 294240ff upstream.

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>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0b99ffc6
...@@ -712,7 +712,7 @@ int __weak pci_register_io_range(phys_addr_t addr, resource_size_t size) ...@@ -712,7 +712,7 @@ int __weak pci_register_io_range(phys_addr_t addr, resource_size_t size)
} }
/* add the range to the list */ /* add the range to the list */
range = kzalloc(sizeof(*range), GFP_KERNEL); range = kzalloc(sizeof(*range), GFP_ATOMIC);
if (!range) { if (!range) {
err = -ENOMEM; err = -ENOMEM;
goto end_register; goto end_register;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment