firewire: core: put GFP_ATOMIC back in fw_node_create()

Message ID e300faf3-ad5c-4702-a022-128c8c983e21@kili.mountain
State New
Headers
Series firewire: core: put GFP_ATOMIC back in fw_node_create() |

Commit Message

Dan Carpenter July 17, 2023, 9:50 a.m. UTC
  This was recently changed from GFP_ATOMIC to GFP_KERNEL, but it
needs to be GFP_ATOMIC so change it back.  The problematic
call tree is:

fw_core_handle_bus_reset() <- spin_lock_irqsave(&card->lock, flags);
-> build_tree()
   -> fw_node_create() <- sleeping allocation

Fixes: 06f45435d985 ("firewire: core: obsolete usage of GFP_ATOMIC at building node tree")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/firewire/core-topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c
index 88466b663482..f40c81534381 100644
--- a/drivers/firewire/core-topology.c
+++ b/drivers/firewire/core-topology.c
@@ -101,7 +101,7 @@  static struct fw_node *fw_node_create(u32 sid, int port_count, int color)
 {
 	struct fw_node *node;
 
-	node = kzalloc(struct_size(node, ports, port_count), GFP_KERNEL);
+	node = kzalloc(struct_size(node, ports, port_count), GFP_ATOMIC);
 	if (node == NULL)
 		return NULL;