diff options
author | Jingoo Han <jingoohan1@gmail.com> | 2015-06-18 00:12:27 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-03 09:29:16 -0700 |
commit | a35b0d6cc0ec26fb607f6cf7bc7be5756c5de63e (patch) | |
tree | f3291958c1b1e54fd1eab76fead5048883ecaed6 | |
parent | 0b99ffc6ea42e16fa4c5b01a414ac0f26766a5f4 (diff) | |
download | lwn-a35b0d6cc0ec26fb607f6cf7bc7be5756c5de63e.tar.gz lwn-a35b0d6cc0ec26fb607f6cf7bc7be5756c5de63e.zip |
of/address: use atomic allocation in pci_register_io_range()
commit 294240ffe784e951dc2ef070da04fa31ef6db3a0 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: Jingoo Han <jingoohan1@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/of/address.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c index 6906a3f61bd8..8bfda6ade2c0 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; |