Skip to content

Commit 2a423bc

Browse files
Tomasz Bursztykanashif
Tomasz Bursztyka
authored andcommitted
net/ieee802154: Do not unreference one time too many a fragmented packet
In case the current packet is the same as the cached one, let's not unreference it while clearing the cache. Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent 0ebd300 commit 2a423bc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

subsys/net/l2/ieee802154/ieee802154_fragment.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,14 @@ static inline enum net_verdict fragment_add_to_cache(struct net_pkt *pkt)
530530
/* Assign buffer back to input packet. */
531531
pkt->buffer = cache->pkt->buffer;
532532
cache->pkt->buffer = NULL;
533+
} else {
534+
/* in case pkt == cache->pkt, we don't want
535+
* to unref it while clearing the cach.
536+
*/
537+
cache->pkt = NULL;
533538
}
534539

540+
535541
fragment_reconstruct_packet(pkt);
536542

537543
/* Once reassemble is done, cache is no longer needed. */

0 commit comments

Comments
 (0)