net: lwm2m: remove extra ref/unref in retransmit
During the retransmit cycle we take ref on the outgoing packet, only to immediately unref it. Originally, this was to make sure the net_context handling didn't get rid of the packet when sendto() is called. But after checking, the ref counter is never in danger of going to 0 at this point in the code, so the added ref handling is useless. Signed-off-by: Michael Scott <mike@foundries.io>
This commit is contained in:
parent
1cd137c393
commit
547e449f98
1 changed files with 0 additions and 5 deletions
|
@ -3634,9 +3634,6 @@ static void retransmit_request(struct k_work *work)
|
|||
return;
|
||||
}
|
||||
|
||||
/* ref pkt to avoid being freed after net_app_send_pkt() */
|
||||
net_pkt_ref(pending->pkt);
|
||||
|
||||
LOG_DBG("Resending message: %p", msg);
|
||||
msg->send_attempts++;
|
||||
/*
|
||||
|
@ -3669,8 +3666,6 @@ static void retransmit_request(struct k_work *work)
|
|||
return;
|
||||
}
|
||||
|
||||
/* unref to balance ref we made for sendto() */
|
||||
net_pkt_unref(pending->pkt);
|
||||
k_delayed_work_submit(&client_ctx->retransmit_work, pending->timeout);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue