net: lwm2m: don't use pending pkt on retransmit error
We are using msg->cpkt.pkt as the net_pkt pointer in the call to net_app_send_pkt(). Let's keep the code clean and not expose ourselves to "out of order" issues, by also using msg->cpkt.pkt in the error handling unref call. Signed-off-by: Michael Scott <mike@foundries.io>
This commit is contained in:
parent
547e449f98
commit
64c03819ec
1 changed files with 1 additions and 1 deletions
|
@ -3649,7 +3649,7 @@ static void retransmit_request(struct k_work *work)
|
|||
if (r < 0) {
|
||||
LOG_ERR("Error sending lwm2m message: %d", r);
|
||||
/* don't error here, retry until timeout */
|
||||
net_pkt_unref(pending->pkt);
|
||||
net_pkt_unref(msg->cpkt.pkt);
|
||||
}
|
||||
|
||||
if (!coap_pending_cycle(pending)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue