From: Jingoo Han Date: Wed, 17 Jun 2015 15:12:27 +0000 (+0900) Subject: of/address: use atomic allocation in pci_register_io_range() X-Git-Tag: v3.18.18~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d42b6b4635df53180e781d392f6441744c34b62e;p=thirdparty%2Fkernel%2Fstable.git of/address: use atomic allocation in pci_register_io_range() [ Upstream commit 294240ffe784e951dc2ef070da04fa31ef6db3a0 ] 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 Cc: stable@vger.kernel.org # 3.18+ Signed-off-by: Rob Herring Signed-off-by: Sasha Levin --- diff --git a/drivers/of/address.c b/drivers/of/address.c index d880affa04939..1dba1a9c1fcfe 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;