aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jingoohan1@gmail.com>2015-06-17 11:12:27 -0400
committerRob Herring <robh@kernel.org>2015-06-23 11:17:40 -0400
commit294240ffe784e951dc2ef070da04fa31ef6db3a0 (patch)
tree0bb96bd339fc6326bd4b876f4695ebc8f105465f
parent72d942e23cdab62fba0337403db218dcc9973494 (diff)
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 <jingoohan1@gmail.com> Cc: stable@vger.kernel.org # 3.18+ Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--drivers/of/address.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 78a7dcbec7d8..65c3289fb2dc 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -712,7 +712,7 @@ int __weak pci_register_io_range(phys_addr_t addr, resource_size_t size)
712 } 712 }
713 713
714 /* add the range to the list */ 714 /* add the range to the list */
715 range = kzalloc(sizeof(*range), GFP_KERNEL); 715 range = kzalloc(sizeof(*range), GFP_ATOMIC);
716 if (!range) { 716 if (!range) {
717 err = -ENOMEM; 717 err = -ENOMEM;
718 goto end_register; 718 goto end_register;