Skip to content

Commit f10f727

Browse files
Dan Carpentergregkh
authored andcommitted
PCI: Fix pci_dev_str_match_path() alloc while atomic bug
[ Upstream commit 7eb6ea4 ] pci_dev_str_match_path() is often called with a spinlock held so the allocation has to be atomic. The call tree is: pci_specified_resource_alignment() <-- takes spin_lock(); pci_dev_str_match() pci_dev_str_match_path() Fixes: 45db337 ("PCI: Allow specifying devices using a base bus and path of devfns") Link: https://lore.kernel.org/r/20210812070004.GC31863@kili Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ed44be1 commit f10f727

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/pci/pci.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int pci_dev_str_match_path(struct pci_dev *dev, const char *path,
265265

266266
*endptr = strchrnul(path, ';');
267267

268-
wpath = kmemdup_nul(path, *endptr - path, GFP_KERNEL);
268+
wpath = kmemdup_nul(path, *endptr - path, GFP_ATOMIC);
269269
if (!wpath)
270270
return -ENOMEM;
271271

0 commit comments

Comments
 (0)