At least within testing environment, by replaying candumps, we can get same address claiming requests from same ECUs. As well, it should be valid for "Request for Address Claim" case, see (SAE J1939 81, 4.4.5 Requests for Address Claimed for Self-Configurable Addressing CAs). Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> --- net/can/j1939/address-claim.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/can/j1939/address-claim.c b/net/can/j1939/address-claim.c index 43082c0aef60..afbe73f1dc5f 100644 --- a/net/can/j1939/address-claim.c +++ b/net/can/j1939/address-claim.c @@ -177,15 +177,13 @@ static void j1939_ac_process(struct j1939_priv *priv, struct sk_buff *skb) ecu->addr = skcb->addr.sa; prev = j1939_ecu_get_by_addr_locked(priv, skcb->addr.sa); - if (prev == ecu) { - j1939_ecu_put(prev); - } else if (prev) { + if (prev) { if (ecu->name > prev->name) { j1939_ecu_unmap_locked(ecu); j1939_ecu_put(prev); goto out_ecu_put; } else { - /* kick prev */ + /* kick prev if less or equal */ j1939_ecu_unmap_locked(prev); j1939_ecu_put(prev); } -- 2.19.1