Conversation

Takashi Sakamoto (坂本 貴史)

https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git/tree/drivers/firewire/core-topology.c?h=v6.16#n263

```
235 list_for_each_entry(node, &list, link) {
...
245 list_add_tail(&child->link, &list);
248 ...
249 }
```

Oops...
1
0
0

@takaswie

It is very easy to get things wrong with the list API. My favorite property is that the list_add arguments can be swapped and the compiler doesn't complain at all. It even works as long you have only one element at the time...

1
0
0

Takashi Sakamoto (坂本 貴史)

Edited 23 days ago
@wagi

I think that one of solutions is to make flat list of fw_node. In IEEE 1394 specification, a bus can hold nodes up to 63. We can use 512 bytes kernel stack to keep pointers to the nodes, then release these references.
0
0
1