of/address: use atomic allocation in pci_register_io_range()
authorJingoo Han <jingoohan1@gmail.com>
Wed, 17 Jun 2015 15:12:27 +0000 (00:12 +0900)
committerRob Herring <robh@kernel.org>
Tue, 23 Jun 2015 15:17:40 +0000 (10:17 -0500)
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 <jingoohan1@gmail.com>
Cc: stable@vger.kernel.org # 3.18+
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/address.c

index 78a7dcbec7d8990ac37adad938a0aff3420423e2..65c3289fb2dc4d039aa827cd83145239f34ddb0c 100644 (file)
@@ -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;
This page took 0.026577 seconds and 5 git commands to generate.