Skip to content

Commit

Permalink
drivers/apc_modbus.c: _apc_modbus_reopen(): do not assume the first m…
Browse files Browse the repository at this point in the history
…atcher in the list is the old reopen_matcher(), rely on _apc_modbus_create_reopen_matcher() to do the right job [#2609]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jan 29, 2025
1 parent 2c8663f commit 4458262
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/apc_modbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,9 @@ static int _apc_modbus_reopen(void)

#if defined NUT_MODBUS_HAS_USB
/* We might have matched a new device in the modbus_connect callback.
* Because of this we want a new exact matcher. */
best_matcher = best_matcher->next;
* Because of this we want a new exact matcher. The method will drop
* the old reopen_matcher from our list starting at best_matcher, and
* from memory. */
_apc_modbus_create_reopen_matcher();
#endif /* defined NUT_MODBUS_HAS_USB */

Expand Down

0 comments on commit 4458262

Please sign in to comment.