Skip to content

Commit 1107aac

Browse files
committed
firewire: core: fix to update generation field in topology map
The generation field of topology map is updated after initialized by zero. The updated value of generation field is always zero, and is against specification. This commit fixes the bug. Fixes: 7d138cb ("firewire: core: use spin lock specific to topology map") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
1 parent 3733912 commit 1107aac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/firewire/core-topology.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,13 @@ static void update_topology_map(__be32 *buffer, size_t buffer_size, int root_nod
441441
const u32 *self_ids, int self_id_count)
442442
{
443443
__be32 *map = buffer;
444+
u32 next_generation = be32_to_cpu(buffer[1]) + 1;
444445
int node_count = (root_node_id & 0x3f) + 1;
445446

446447
memset(map, 0, buffer_size);
447448

448449
*map++ = cpu_to_be32((self_id_count + 2) << 16);
449-
*map++ = cpu_to_be32(be32_to_cpu(buffer[1]) + 1);
450+
*map++ = cpu_to_be32(next_generation);
450451
*map++ = cpu_to_be32((node_count << 16) | self_id_count);
451452

452453
while (self_id_count--)

0 commit comments

Comments
 (0)