summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorJingoo Han <jingoohan1@gmail.com>2015-06-18 00:12:27 +0900
committerRob Herring <robh@kernel.org>2015-06-23 10:17:40 -0500
commit294240ffe784e951dc2ef070da04fa31ef6db3a0 (patch)
tree0bb96bd339fc6326bd4b876f4695ebc8f105465f /drivers/of
parent72d942e23cdab62fba0337403db218dcc9973494 (diff)
downloadop-kernel-dev-294240ffe784e951dc2ef070da04fa31ef6db3a0.zip
op-kernel-dev-294240ffe784e951dc2ef070da04fa31ef6db3a0.tar.gz
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>
Diffstat (limited to 'drivers/of')
-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 78a7dcb..65c3289 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)
}
/* 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;
OpenPOWER on IntegriCloud