All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: fix a scheduling in atomic bug
@ 2021-08-12  7:00 Dan Carpenter
  2021-08-12 15:19 ` Logan Gunthorpe
  2021-08-12 19:16 ` Bjorn Helgaas
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-08-12  7:00 UTC (permalink / raw)
  To: Bjorn Helgaas, Logan Gunthorpe
  Cc: Alex Williamson, Christian König, Stephen Bates, linux-pci,
	kernel-janitors

This function 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: 07d8d7e57c28 ("PCI: Make specifying PCI devices in kernel parameters reusable")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6714c58ce321..71baf5ff48fc 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -269,7 +269,7 @@ static int pci_dev_str_match_path(struct pci_dev *dev, const char *path,
 
 	*endptr = strchrnul(path, ';');
 
-	wpath = kmemdup_nul(path, *endptr - path, GFP_KERNEL);
+	wpath = kmemdup_nul(path, *endptr - path, GFP_ATOMIC);
 	if (!wpath)
 		return -ENOMEM;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-13  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-12  7:00 [PATCH] PCI: fix a scheduling in atomic bug Dan Carpenter
2021-08-12 15:19 ` Logan Gunthorpe
2021-08-13  7:27   ` Dan Carpenter
2021-08-12 19:16 ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.